[llvm] 7154f89 - [FunctionAttrs] Add additional tests with operand bundles (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 03:39:23 PDT 2022


Author: Nikita Popov
Date: 2022-10-27T12:39:15+02:00
New Revision: 7154f89c1ab9dcf63a0cc47c413b600a793ffa7a

URL: https://github.com/llvm/llvm-project/commit/7154f89c1ab9dcf63a0cc47c413b600a793ffa7a
DIFF: https://github.com/llvm/llvm-project/commit/7154f89c1ab9dcf63a0cc47c413b600a793ffa7a.diff

LOG: [FunctionAttrs] Add additional tests with operand bundles (NFC)

Added: 
    

Modified: 
    llvm/test/Transforms/FunctionAttrs/readattrs.ll
    llvm/test/Transforms/FunctionAttrs/writeonly.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/FunctionAttrs/readattrs.ll b/llvm/test/Transforms/FunctionAttrs/readattrs.ll
index 511fc8d5c5d9a..a982832fa37dd 100644
--- a/llvm/test/Transforms/FunctionAttrs/readattrs.ll
+++ b/llvm/test/Transforms/FunctionAttrs/readattrs.ll
@@ -322,3 +322,46 @@ loop:
 exit:
   ret void
 }
+
+declare void @readnone_param(ptr nocapture readnone %p)
+declare void @readonly_param(ptr nocapture readonly %p)
+
+define void @op_bundle_readnone_deopt(ptr %p) {
+; CHECK-LABEL: define {{[^@]+}}@op_bundle_readnone_deopt
+; CHECK-SAME: (ptr nocapture readnone [[P:%.*]]) {
+; CHECK-NEXT:    call void @readnone_param(ptr [[P]]) [ "deopt"() ]
+; CHECK-NEXT:    ret void
+;
+  call void @readnone_param(ptr %p) ["deopt"()]
+  ret void
+}
+
+define void @op_bundle_readnone_unknown(ptr %p) {
+; CHECK-LABEL: define {{[^@]+}}@op_bundle_readnone_unknown
+; CHECK-SAME: (ptr nocapture readnone [[P:%.*]]) {
+; CHECK-NEXT:    call void @readnone_param(ptr [[P]]) [ "unknown"() ]
+; CHECK-NEXT:    ret void
+;
+  call void @readnone_param(ptr %p) ["unknown"()]
+  ret void
+}
+
+define void @op_bundle_readonly_deopt(ptr %p) {
+; CHECK-LABEL: define {{[^@]+}}@op_bundle_readonly_deopt
+; CHECK-SAME: (ptr nocapture readonly [[P:%.*]]) {
+; CHECK-NEXT:    call void @readonly_param(ptr [[P]]) [ "deopt"() ]
+; CHECK-NEXT:    ret void
+;
+  call void @readonly_param(ptr %p) ["deopt"()]
+  ret void
+}
+
+define void @op_bundle_readonly_unknown(ptr %p) {
+; CHECK-LABEL: define {{[^@]+}}@op_bundle_readonly_unknown
+; CHECK-SAME: (ptr nocapture readonly [[P:%.*]]) {
+; CHECK-NEXT:    call void @readonly_param(ptr [[P]]) [ "unknown"() ]
+; CHECK-NEXT:    ret void
+;
+  call void @readonly_param(ptr %p) ["unknown"()]
+  ret void
+}

diff  --git a/llvm/test/Transforms/FunctionAttrs/writeonly.ll b/llvm/test/Transforms/FunctionAttrs/writeonly.ll
index 0ad158500c24e..e4d1347ff9f2b 100644
--- a/llvm/test/Transforms/FunctionAttrs/writeonly.ll
+++ b/llvm/test/Transforms/FunctionAttrs/writeonly.ll
@@ -178,6 +178,16 @@ define void @direct3b(ptr %p) {
   ret void
 }
 
+define void @direct3c(ptr %p) {
+; CHECK-LABEL: define {{[^@]+}}@direct3c
+; CHECK-SAME: (ptr nocapture writeonly [[P:%.*]]) {
+; CHECK-NEXT:    call void @direct3_callee(ptr [[P]]) [ "may-read"() ]
+; CHECK-NEXT:    ret void
+;
+  call void @direct3_callee(ptr %p) ["may-read"()]
+  ret void
+}
+
 define void @fptr_test1(ptr %p, ptr %f) {
 ; CHECK-LABEL: define {{[^@]+}}@fptr_test1
 ; CHECK-SAME: (ptr [[P:%.*]], ptr nocapture readonly [[F:%.*]]) {


        


More information about the llvm-commits mailing list