Skip to content

Commit 3ebeba2

Browse files
committed
IR: Make llvm.fake.use a DefaultAttrsIntrinsic
This shouldn't be special and is just an ordinary sideeffect.
1 parent 297f6d9 commit 3ebeba2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,8 @@ def int_is_constant : DefaultAttrsIntrinsic<[llvm_i1_ty], [llvm_any_ty],
18811881
"llvm.is.constant">;
18821882

18831883
// Introduce a use of the argument without generating any code.
1884-
def int_fake_use : Intrinsic<[], [llvm_vararg_ty]>;
1884+
def int_fake_use : DefaultAttrsIntrinsic<[], [llvm_vararg_ty],
1885+
[IntrHasSideEffects, IntrInaccessibleMemOnly, IntrWillReturn]>;
18851886

18861887
// Intrinsic to mask out bits of a pointer.
18871888
// First argument must be pointer or vector of pointer. This is checked by the

llvm/test/CodeGen/AMDGPU/lower-kernargs.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,13 +1837,13 @@ attributes #2 = { nounwind "target-cpu"="tahiti" }
18371837
!llvm.module.flags = !{!0}
18381838
!0 = !{i32 1, !"amdhsa_code_object_version", i32 500}
18391839
;.
1840-
; HSA: attributes #[[ATTR0:[0-9]+]] = { nounwind }
1840+
; HSA: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
18411841
; HSA: attributes #[[ATTR1:[0-9]+]] = { nounwind "target-cpu"="kaveri" }
18421842
; HSA: attributes #[[ATTR2:[0-9]+]] = { nounwind "amdgpu-implicitarg-num-bytes"="40" "target-cpu"="kaveri" }
18431843
; HSA: attributes #[[ATTR3:[0-9]+]] = { nounwind "target-cpu"="tahiti" }
18441844
; HSA: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
18451845
;.
1846-
; MESA: attributes #[[ATTR0:[0-9]+]] = { nounwind }
1846+
; MESA: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
18471847
; MESA: attributes #[[ATTR1:[0-9]+]] = { nounwind "target-cpu"="kaveri" }
18481848
; MESA: attributes #[[ATTR2:[0-9]+]] = { nounwind "amdgpu-implicitarg-num-bytes"="40" "target-cpu"="kaveri" }
18491849
; MESA: attributes #[[ATTR3:[0-9]+]] = { nounwind "target-cpu"="tahiti" }

0 commit comments

Comments
 (0)