Skip to content

Commit

Permalink
Fix decayaddr to handle stores into the decayed addr (#1109)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheng Gong authored Oct 25, 2023
1 parent c6b265b commit 558abc5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,16 @@ function fix_decayaddr!(mod::LLVM.Module)
temp = nothing
for u in LLVM.uses(inst)
st = LLVM.user(u)
if !isa(st, LLVM.CallInst)
# Storing _into_ the decay addr is okay
# we just cannot store the decayed addr into
# somewhere
if isa(st, LLVM.StoreInst)
if operands(st)[2] == inst
LLVM.API.LLVMSetOperand(st, 2-1, operands(inst)[1])
continue
end
end
if !isa(st, LLVM.CallInst)
bt = GPUCompiler.backtrace(st)
msg = sprint() do io::IO
println(io, string(f))
Expand Down

0 comments on commit 558abc5

Please sign in to comment.