From a7f2986e5d39dba805c1ca942df98ecc71f27734 Mon Sep 17 00:00:00 2001 From: Cody Tapscott Date: Thu, 31 Aug 2023 00:42:29 -0400 Subject: [PATCH] Fix `ZeroBundle` wrapping for GlobalRef PhiNode args These are not legal to insert in-place. Thankfully, since these are just constants anyway we can evaluate the result in-place. --- src/codegen/forward_demand.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen/forward_demand.jl b/src/codegen/forward_demand.jl index 632c0a09..7d0a85ee 100644 --- a/src/codegen/forward_demand.jl +++ b/src/codegen/forward_demand.jl @@ -262,7 +262,7 @@ function forward_diff_no_inf!(ir::IRCode, to_diff::Vector{Pair{SSAValue,Int}}; return transform!(ir, arg, order, maparg) elseif isa(arg, GlobalRef) @assert isconst(arg) - return insert_node!(ir, ssa, NewInstruction(Expr(:call, ZeroBundle{order}, arg))) + return ZeroBundle{order}(getfield(arg.mod, arg.name)) elseif isa(arg, QuoteNode) return ZeroBundle{order}(arg.value) end