Skip to content

Commit

Permalink
Handle load from global constant in gc fixup (#1179)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Dec 3, 2023
1 parent e627736 commit 9d6963c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,18 @@ function nodecayed_phis!(mod::LLVM.Module)
return getparent(operands(v)[1], offset, true)
end

if addr == 13 && isa(v, LLVM.ConstantExpr)
if opcode(v) == LLVM.API.LLVMAddrSpaceCast
v2 = operands(v)[1]
if addrspace(value_type(v2)) == 0
if addr == 13 && isa(v, LLVM.ConstantExpr)
v2 = const_addrspacecast(operands(v)[1], LLVM.PointerType(eltype(value_type(v)), 10))
return v2, offset, hasload
end
end
end
end

if isa(v, LLVM.AddrSpaceCastInst)
if addrspace(value_type(operands(v)[1])) == 0
v2 = addrspacecast!(b, operands(v)[1], LLVM.PointerType(eltype(value_type(v)), 10))
Expand Down

0 comments on commit 9d6963c

Please sign in to comment.