Skip to content

Commit

Permalink
Only mark writeonly if pointer abi
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Dec 4, 2024
1 parent 358d647 commit af749d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/llvm/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,10 @@ function annotate!(mod::LLVM.Module)
for fn in funcs[fname]
push!(parameter_attributes(fn, 2), LLVM.StringAttribute("enzyme_inactive"))
push!(parameter_attributes(fn, 4), LLVM.StringAttribute("enzyme_inactive"))
push!(parameter_attributes(fn, 4), LLVM.EnumAttribute("writeonly"))
push!(parameter_attributes(fn, 4), LLVM.EnumAttribute("nocapture"))
if value_type(LLVM.parameters(fn, 4)) isa LLVM.PointerType
push!(parameter_attributes(fn, 4), LLVM.EnumAttribute("writeonly"))
push!(parameter_attributes(fn, 4), LLVM.EnumAttribute("nocapture"))
end
if LLVM.version().major <= 15
push!(function_attributes(fn), LLVM.EnumAttribute("argmemonly"))
else
Expand Down

0 comments on commit af749d0

Please sign in to comment.