Skip to content

PhoNode is not handled properly on Julia 1.11+ #60

@dfdx

Description

@dfdx

Currently, the following test fails:

function conditionally_defined_tester(x)
    isneg = x < 0
    if isneg
        y = 1.0
    end
    if isneg
        x += y
    end
    return x
end

@testset "undef in PhiNode" begin
    res, tape = trace(conditionally_defined_tester, 5.0)
    @test res == conditionally_defined_tester(5.0)
    @test play!(tape, conditionally_defined_tester, 5.0) == res
end

giving the following error:

undef in PhiNode: Error During Test at REPL[224]:1
  Got exception outside of a @test
  KeyError: key :(%15) not found
  Stacktrace:
    [1] getindex(h::Dict{Union{Core.Argument, Core.SSAValue}, Any}, key::Core.SSAValue)
      @ Base ./dict.jl:477
    [2] trace_block!(t::Umlaut.Tracer, ir::Core.Compiler.IRCode, bi::Integer, prev_bi::Integer, sparams::Any, sparams_dict::Any)
      @ Umlaut ~/work/Umlaut.jl/src/trace.jl:382
    [3] trace!(t::Umlaut.Tracer, v_fargs::Any)
      @ Umlaut ~/work/Umlaut.jl/src/trace.jl:594
    [4] trace(::Any, ::Any, ::Vararg{Any}; ctx::Any, deprecated_kws...)
      @ Umlaut ~/work/Umlaut.jl/src/trace.jl:702
    [5] trace(::Any, ::Any, ::Vararg{Any})
      @ Umlaut ~/work/Umlaut.jl/src/trace.jl:697

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions