-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Comparing changes
Open a pull request
base repository: JuliaLang/julia
base: 8e61753
head repository: JuliaLang/julia
compare: c988bcc
- 15 commits
- 34 files changed
- 14 contributors
Commits on Mar 24, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 2099987 - Browse repository at this point
Copy the full SHA 2099987View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7189c81 - Browse repository at this point
Copy the full SHA 7189c81View commit details -
Add missing gc root in codegen (#44724)
In #44635, we observe that occasionally a call to `view(::SubArray, ::Colon, ...)` dispatches to the wrong function. The post-inlining IR is in relevant part: ``` │ │ %8 = (isa)(I, Tuple{Colon, UnitRange{Int64}, SubArray{Int64, 2, UnitRange{Int64}, Tuple{Matrix{Int64}}, false}})::Bool └───│ goto #3 if not %8 2 ──│ %10 = π (I, Tuple{Colon, UnitRange{Int64}, SubArray{Int64, 2, UnitRange{Int64}, Tuple{Matrix{Int64}}, false}}) │ │ @ indices.jl:324 within `to_indices` @ multidimensional.jl:859 │ │┌ @ multidimensional.jl:864 within `uncolon` │ ││┌ @ indices.jl:351 within `Slice` @ indices.jl:351 │ │││ %11 = %new(Base.Slice{Base.OneTo{Int64}}, %7)::Base.Slice{Base.OneTo{Int64}} │ │└└ │ │┌ @ essentials.jl:251 within `tail` │ ││ %12 = Core.getfield(%10, 2)::UnitRange{Int64} │ ││ %13 = Core.getfield(%10, 3)::SubArray{Int64, 2, UnitRange{Int64}, Tuple{Matrix{Int64}}, false} │ │└ │ │ @ indices.jl:324 within `to_indices` └───│ goto #5 │ @ indices.jl:324 within `to_indices` @ indices.jl:333 │┌ @ tuple.jl:29 within `getindex` 3 ──││ %15 = Base.getfield(I, 1, true)::Function │ │└ │ │ invoke Base.to_index(A::SubArray{Int64, 3, Array{Int64, 3}, Tuple{Vector{Int64}, Base.Slice{Base.OneTo{Int64}}, UnitRange{Int64}}, false}, %15::Function)::Union{} ``` Here we expect the `isa` at `%8` to always be [1]. However, we seemingly observe the result that the branch is not taken and we instead end up in the fallback `to_index`, which (correctly) complains that the colon should have been dereferenced to an index. After some investigation of the relevant rr trace, what turns out to happen here is that the va tuple we compute in codegen gets garbage collected before the call to `emit_isa`, causing a use-after-free read, which happens to make `emit_isa` think that the isa condition is impossible, causing it to fold the branch away. The fix is to simply add the relevant GC root. It's a bit unfortunate that this wasn't caught by the GC verifier. It would have in principle been capable of doing so, but it is currently disabled for C++ sources. It would be worth revisiting this in the future to see if it can't be made to work. Fixes #44635. [1] The specialization heuristics decided to widen `Colon` to `Function`, which doesn't make much sense here, but regardless, it shouldn't crash.
Configuration menu - View commit details
-
Copy full SHA for 424785a - Browse repository at this point
Copy the full SHA 424785aView commit details -
build: allow
Make.user
to tweak bootstrap debug level (#44728)The `-g1` option for bootstrapping is especially useful to get Julia-level stacktrace in a case when some hard-to-debug error happened inside `Core.Compiler`. Now we can define to enable it locally without modification on Make.inc: > Make.user ``` BOOTSTRAP_DEBUG_LEVEL=1 ```
Configuration menu - View commit details
-
Copy full SHA for 6ce817b - Browse repository at this point
Copy the full SHA 6ce817bView commit details
Commits on Mar 25, 2022
-
optimizer: switch to more general data structure of
SSADefUse
(#44730)Now `(du::SSADefUse).uses` field can contain arbitrary "usages" to be eliminated. This structure might be helpful for implementing array SROA, for example. Also slightly tweaks the implementation of `ccall` preserve elimination.
2Configuration menu - View commit details
-
Copy full SHA for b449ea5 - Browse repository at this point
Copy the full SHA b449ea5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 68e2969 - Browse repository at this point
Copy the full SHA 68e2969View commit details -
Configuration menu - View commit details
-
Copy full SHA for ea82910 - Browse repository at this point
Copy the full SHA ea82910View commit details -
Use correct variable for threads auto (#44747)
--threads=auto uses jl_effective_threads to determine the number of threads to use, so make sure the tests do too, otherwise this test will fail on our new cpu-restricted runners.
2Configuration menu - View commit details
-
Copy full SHA for 5dc6155 - Browse repository at this point
Copy the full SHA 5dc6155View commit details
Commits on Mar 26, 2022
-
Fix eltype determination in
det
(#44582)Co-authored-by: Andreas Noack <[email protected]>
2Configuration menu - View commit details
-
Copy full SHA for 9b21691 - Browse repository at this point
Copy the full SHA 9b21691View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba977fa - Browse repository at this point
Copy the full SHA ba977faView commit details -
🤖 Bump the Downloads stdlib from 2a21b15 to a7a0346 (#44738)
Co-authored-by: Dilum Aluthge <[email protected]>
2Configuration menu - View commit details
-
Copy full SHA for 9d31f6a - Browse repository at this point
Copy the full SHA 9d31f6aView commit details
Commits on Mar 27, 2022
-
fix oc lowering with return type annotations (#44727)
fixes #44723 Co-authored-by: Takafumi Arakaki <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 19eb307 - Browse repository at this point
Copy the full SHA 19eb307View commit details -
[Random] Document
default_rng
and remove references toGLOBAL_RNG
(……#44733) * [Random] Document `default_rng` and remove references to `GLOBAL_RNG` * [Random] Remove last references to `GLOBAL_RNG` in `seed!` docstring While the method does use `GLOBAL_RNG` by default, that's an implementation detail, and it eventually uses `default_rng()` internally.
Configuration menu - View commit details
-
Copy full SHA for b297cc4 - Browse repository at this point
Copy the full SHA b297cc4View commit details
Commits on Mar 28, 2022
-
optimizer: eliminate more
isdefined
checks (#44755)Follows up #44708 -- in that PR I missed the most obvious optimization opportunity, i.e. we can safely eliminate `isdefined` checks when all fields are defined at allocation site. This change allows us to eliminate capturing closure constructions when the body and callsite of capture closure is available within a optimized frame, e.g.: ```julia function abmult(r::Int, x0) if r < 0 r = -r end f = x -> x * r return @inline f(x0) end ``` ```diff diff --git a/_master.jl b/_pr.jl index ea06d865b75..c38f221090f 100644 --- a/_master.jl +++ b/_pr.jl @@ -1,24 +1,19 @@ julia> @code_typed abmult(-3, 3) CodeInfo( -1 ── %1 = Core.Box::Type{Core.Box} -│ %2 = %new(%1, r@_2)::Core.Box -│ %3 = Core.isdefined(%2, :contents)::Bool -└─── goto #3 if not %3 +1 ── goto #3 if not true 2 ── goto #4 3 ── $(Expr(:throw_undef_if_not, :r, false))::Any -4 ┄─ %7 = (r@_2 < 0)::Any -└─── goto #9 if not %7 -5 ── %9 = Core.isdefined(%2, :contents)::Bool -└─── goto #7 if not %9 +4 ┄─ %4 = (r@_2 < 0)::Any +└─── goto #9 if not %4 +5 ── goto #7 if not true 6 ── goto #8 7 ── $(Expr(:throw_undef_if_not, :r, false))::Any -8 ┄─ %13 = -r@_2::Any -9 ┄─ %14 = φ (#4 => r@_2, #8 => %13)::Any -│ %15 = Core.isdefined(%2, :contents)::Bool -└─── goto #11 if not %15 +8 ┄─ %9 = -r@_2::Any +9 ┄─ %10 = φ (#4 => r@_2, #8 => %9)::Any +└─── goto #11 if not true 10 ─ goto #12 11 ─ $(Expr(:throw_undef_if_not, :r, false))::Any -12 ┄ %19 = (x0 * %14)::Any +12 ┄ %14 = (x0 * %10)::Any └─── goto #13 -13 ─ return %19 +13 ─ return %14 ) => Any ```
2Configuration menu - View commit details
-
Copy full SHA for 89a613b - Browse repository at this point
Copy the full SHA 89a613bView commit details -
Configuration menu - View commit details
-
Copy full SHA for c988bcc - Browse repository at this point
Copy the full SHA c988bccView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 8e61753...c988bcc