Skip to content

[IR] Fix incorrect writeonly on llvm.allow.ubsan/runtime.check #145492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/include/llvm/IR/Intrinsics.td
Original file line number Diff line number Diff line change
Expand Up @@ -1842,11 +1842,11 @@ def int_ubsantrap : Intrinsic<[], [llvm_i8_ty],

// Return true if ubsan check is allowed.
def int_allow_ubsan_check : DefaultAttrsIntrinsic<[llvm_i1_ty], [llvm_i8_ty],
[IntrInaccessibleMemOnly, IntrWriteMem, ImmArg<ArgIndex<0>>, NoUndef<RetIndex>]>;
[IntrInaccessibleMemOnly, ImmArg<ArgIndex<0>>, NoUndef<RetIndex>]>;

// Return true if runtime check is allowed.
def int_allow_runtime_check : DefaultAttrsIntrinsic<[llvm_i1_ty], [llvm_metadata_ty],
[IntrInaccessibleMemOnly, IntrWriteMem, NoUndef<RetIndex>]>,
[IntrInaccessibleMemOnly, NoUndef<RetIndex>]>,
ClangBuiltin<"__builtin_allow_runtime_check">;

// Support for dynamic deoptimization (or de-specialization)
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Instrumentation/BoundsChecking/runtimes.ll
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ define void @f1(i64 %x) nounwind {
; TR-GUARD: attributes #[[ATTR3]] = { nomerge noreturn nounwind }
;.
; RT-GUARD: attributes #[[ATTR0]] = { nounwind }
; RT-GUARD: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
; RT-GUARD: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
; RT-GUARD: attributes #[[ATTR2]] = { nomerge nounwind }
;.
; TR: [[META0]] = !{}
Expand Down
Loading