From 2309abd2fd510ab6b400df030f16004e8ca79512 Mon Sep 17 00:00:00 2001 From: William Moses Date: Sun, 5 Jan 2025 11:01:57 -0500 Subject: [PATCH] Fix 1.11 arg based gc rewrite (#2250) * Update transforms.jl * Update transforms.jl * Update transforms.jl * Update transforms.jl * Update transforms.jl --- src/llvm/transforms.jl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/llvm/transforms.jl b/src/llvm/transforms.jl index 02da055b77..b2559000d3 100644 --- a/src/llvm/transforms.jl +++ b/src/llvm/transforms.jl @@ -563,7 +563,18 @@ function nodecayed_phis!(mod::LLVM.Module) while length(addrtodo) != 0 v = pop!(addrtodo) base, toffset = get_base_and_offset(v) - if offset === nothing + + if in(base, seen) + continue + end + push!(seen, base) + if isa(base, LLVM.PHIInst) + for (v, _) in LLVM.incoming(base) + push!(addrtodo, v) + end + continue + end + if offset === nothing offset = toffset else if offset != toffset @@ -571,19 +582,9 @@ function nodecayed_phis!(mod::LLVM.Module) break end end - if in(base, seen) - continue - end - push!(seen, base) if isa(base, LLVM.Argument) && addrspace(value_type(base)) == 11 continue end - if isa(base, LLVM.PHIInst) - for (v, _) in LLVM.incoming(base) - push!(addrtodo, v) - end - continue - end all_args = false break end