Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: JuliaLang/julia Loading
base: 8e61753
Choose a base ref
...
head repository: JuliaLang/julia Loading
compare: c988bcc
Choose a head ref
  • 15 commits
  • 34 files changed
  • 14 contributors

Commits on Mar 24, 2022

  1. Configuration menu
    Copy the full SHA
    2099987 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7189c81 View commit details
    Browse the repository at this point in the history
  3. 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.
    Keno committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    424785a View commit details
    Browse the repository at this point in the history
  4. 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
    ```
    aviatesk committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    6ce817b View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2022

  1. 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.
    aviatesk committed Mar 25, 2022
    2 Configuration menu
    Copy the full SHA
    b449ea5 View commit details
    Browse the repository at this point in the history
  2. Recover 1.7's behavior (#44736)

    Fix #44734.
    N5N3 committed Mar 25, 2022
    Configuration menu
    Copy the full SHA
    68e2969 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ea82910 View commit details
    Browse the repository at this point in the history
  4. 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.
    Keno committed Mar 25, 2022
    2 Configuration menu
    Copy the full SHA
    5dc6155 View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2022

  1. Fix eltype determination in det (#44582)

    Co-authored-by: Andreas Noack <[email protected]>
    dkarrasch and andreasnoack committed Mar 26, 2022
    2 Configuration menu
    Copy the full SHA
    9b21691 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ba977fa View commit details
    Browse the repository at this point in the history
  3. 2 Configuration menu
    Copy the full SHA
    9d31f6a View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2022

  1. fix oc lowering with return type annotations (#44727)

    fixes #44723
    
    Co-authored-by: Takafumi Arakaki <[email protected]>
    simeonschaub and tkf committed Mar 27, 2022
    Configuration menu
    Copy the full SHA
    19eb307 View commit details
    Browse the repository at this point in the history
  2. [Random] Document default_rng and remove references to GLOBAL_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.
    giordano committed Mar 27, 2022
    Configuration menu
    Copy the full SHA
    b297cc4 View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2022

  1. 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
    ```
    aviatesk committed Mar 28, 2022
    2 Configuration menu
    Copy the full SHA
    89a613b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c988bcc View commit details
    Browse the repository at this point in the history
Loading