Skip to content

Commit

Permalink
Mark gc preserve as readonly (#1724)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Aug 9, 2024
1 parent 957f082 commit 02c5855
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/compiler/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ function is_readonly(f::LLVM.Function)
if intr == LLVM.Intrinsic("llvm.assume").id
return true
end
if LLVM.name(f) == "llvm.julia.gc_preserve_begin" || LLVM.name(f) == "llvm.julia.gc_preserve_end"
return true
end
for attr in collect(function_attributes(f))
if kind(attr) == kind(EnumAttribute("readonly"))
return true
Expand Down Expand Up @@ -149,6 +152,9 @@ function is_readnone(f::LLVM.Function)
if intr == LLVM.Intrinsic("llvm.assume").id
return true
end
if LLVM.name(f) == "llvm.julia.gc_preserve_begin" || LLVM.name(f) == "llvm.julia.gc_preserve_end"
return true
end
for attr in collect(function_attributes(cur))
if kind(attr) == kind(EnumAttribute("readnone"))
return true
Expand All @@ -175,6 +181,9 @@ function is_writeonly(f::LLVM.Function)
if intr == LLVM.Intrinsic("llvm.assume").id
return true
end
if LLVM.name(f) == "llvm.julia.gc_preserve_begin" || LLVM.name(f) == "llvm.julia.gc_preserve_end"
return true
end
for attr in collect(function_attributes(cur))
if kind(attr) == kind(EnumAttribute("readnone"))
return true
Expand Down

0 comments on commit 02c5855

Please sign in to comment.