[llvm] e1dc0f5 - [Attributor] Convert test to opaque pointers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 00:53:23 PDT 2023


Author: Nikita Popov
Date: 2023-06-28T09:53:12+02:00
New Revision: e1dc0f55bd71a6ffce7056f3313be50dfc9fd250

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

LOG: [Attributor] Convert test to opaque pointers (NFC)

This converts the arg-count-mismatch.ll test to opaque pointers.
The bitcasts of the called functions are now implicit and this
affects behavior: We now infer memory attributes. This should be
fine, as function-level attributes are not affected by signature
mismatches.

Differential Revision: https://reviews.llvm.org/D153406

Added: 
    

Modified: 
    llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll b/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll
index 9913827babf71..7c254a8164af7 100644
--- a/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll
+++ b/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal  -attributor-annotate-decl-cs  -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal  -attributor-annotate-decl-cs  -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
 
 ; The original C source looked like this:
 ;
@@ -39,13 +39,13 @@ define dso_local i16 @foo(i16 %a) {
 ; TUNIT-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
 ; TUNIT-NEXT:    ret i16 0
 ;
-; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn
+; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
 ; CGSCC-LABEL: define {{[^@]+}}@foo
 ; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
-; CGSCC-NEXT:    [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]]) #[[ATTR2:[0-9]+]]
+; CGSCC-NEXT:    [[CALL:%.*]] = call noundef i16 @bar(i16 [[A]])
 ; CGSCC-NEXT:    ret i16 [[CALL]]
 ;
-  %call = call i16 bitcast (i16 (i16, i16) * @bar to i16 (i16) *)(i16 %a)
+  %call = call i16 @bar(i16 %a)
   ret i16 %call
 }
 
@@ -62,16 +62,16 @@ define dso_local i16 @foo2(i16 %a) {
 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
 ; TUNIT-LABEL: define {{[^@]+}}@foo2
 ; TUNIT-SAME: (i16 [[A:%.*]]) #[[ATTR0]] {
-; TUNIT-NEXT:    [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]]) #[[ATTR1:[0-9]+]]
+; TUNIT-NEXT:    [[CALL:%.*]] = call i16 @bar2(i16 [[A]]) #[[ATTR1:[0-9]+]]
 ; TUNIT-NEXT:    ret i16 [[CALL]]
 ;
-; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn
+; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
 ; CGSCC-LABEL: define {{[^@]+}}@foo2
 ; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0]] {
-; CGSCC-NEXT:    [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]]) #[[ATTR2]]
+; CGSCC-NEXT:    [[CALL:%.*]] = call i16 @bar2(i16 [[A]])
 ; CGSCC-NEXT:    ret i16 [[CALL]]
 ;
-  %call = call i16 bitcast (i16 (i16, i16) * @bar2 to i16 (i16) *)(i16 %a)
+  %call = call i16 @bar2(i16 %a)
   ret i16 %call
 }
 
@@ -104,16 +104,16 @@ define dso_local i16 @vararg_tests(i16 %a) {
 ; TUNIT-SAME: (i16 [[A:%.*]]) #[[ATTR0]] {
 ; TUNIT-NEXT:    ret i16 14
 ;
-; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn
+; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
 ; CGSCC-LABEL: define {{[^@]+}}@vararg_tests
 ; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0]] {
 ; CGSCC-NEXT:    [[CALL1:%.*]] = call i16 (i16, ...) @vararg_prop(i16 noundef 7, i16 noundef 8, i16 [[A]])
-; CGSCC-NEXT:    [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 7) #[[ATTR2]]
+; CGSCC-NEXT:    [[CALL2:%.*]] = call i16 @vararg_no_prop(i16 noundef 7)
 ; CGSCC-NEXT:    [[ADD:%.*]] = add i16 [[CALL1]], [[CALL2]]
 ; CGSCC-NEXT:    ret i16 [[ADD]]
 ;
   %call1 = call i16 (i16, ...) @vararg_prop(i16 7, i16 8, i16 %a)
-  %call2 = call i16 bitcast (i16 (i16, i16, ...) * @vararg_no_prop to i16 (i16) *) (i16 7)
+  %call2 = call i16 @vararg_no_prop (i16 7)
   %add = add i16 %call1, %call2
   ret i16 %add
 }
@@ -138,11 +138,10 @@ define internal i16 @vararg_no_prop(i16 %p1, i16 %p2, ...) {
 
 ;.
 ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
-; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn memory(none) }
+; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn }
 ;.
-; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn }
+; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
 ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
-; CGSCC: attributes #[[ATTR2]] = { nofree nounwind willreturn }
 ;.
 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
 ; CHECK: {{.*}}


        


More information about the llvm-commits mailing list