Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Oct 31, 2024
1 parent dcd0a37 commit dee9dcd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ function nodecayed_phis!(mod::LLVM.Module)
# Simple handler to fix addrspace 11
#complex handler for addrspace 13, which itself comes from a load of an
# addrspace 10
ctx = LLVM.context(mod)
for f in functions(mod)

guaranteedInactive = false
Expand Down Expand Up @@ -836,15 +837,15 @@ function nodecayed_phis!(mod::LLVM.Module)
pty = TypeTree(API.DT_Pointer, LLVM.context(ld))
only!(pty, -1)
rhs = ptrtoint!(b, get_memory_data(b, operands(v)[1]), offty)
metadata(rhs)["enzyme_type"] = to_md(pty)
metadata(rhs)["enzyme_type"] = to_md(pty, ctx)
lhs = ptrtoint!(b, operands(v)[2], offty)
metadata(rhs)["enzyme_type"] = to_md(pty)
metadata(rhs)["enzyme_type"] = to_md(pty, ctx)
off2 = nuwsub!(b, lhs, rhs)
ity = TypeTree(API.DT_Integer, LLVM.context(ld))
only!(ity, -1)
metadata(off2)["enzyme_type"] = to_md(ity)
metadata(off2)["enzyme_type"] = to_md(ity, ctx)
add = nuwadd!(b, offset, off2)
metadata(add)["enzyme_type"] = to_md(ity)
metadata(add)["enzyme_type"] = to_md(ity, ctx)
return operands(v)[1], add, true
end
end
Expand Down

0 comments on commit dee9dcd

Please sign in to comment.