Skip to content

Commit 36170a2

Browse files
committed
memhash readonly
1 parent 724c622 commit 36170a2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/llvm/attributes.jl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,29 @@ function annotate!(mod::LLVM.Module)
447447
end
448448
end
449449

450+
for fname in
451+
("memhash_seed",)
452+
if haskey(funcs, fname)
453+
for fn in funcs[fname]
454+
if LLVM.version().major <= 15
455+
push!(function_attributes(fn), LLVM.EnumAttribute("readonly"))
456+
else
457+
push!(
458+
function_attributes(fn),
459+
EnumAttribute(
460+
"memory",
461+
MemoryEffect(
462+
(MRI_Ref << getLocationPos(ArgMem)) |
463+
(MRI_NoModRef << getLocationPos(InaccessibleMem)) |
464+
(MRI_NoModRef << getLocationPos(Other)),
465+
).data,
466+
),
467+
)
468+
end
469+
end
470+
end
471+
end
472+
450473
for fname in ("jl_types_equal", "ijl_types_equal")
451474
if haskey(funcs, fname)
452475
for fn in funcs[fname]

0 commit comments

Comments
 (0)