[NFC][SimplifyCFG] Autogenerate checklines in some tests that eliminate unwind edges
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 12 Jan 2023 20:43:38 +0000 (23:43 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 12 Jan 2023 21:41:58 +0000 (00:41 +0300)
llvm/test/Transforms/SimplifyCFG/2011-09-05-TrivialLPad.ll
llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
llvm/test/Transforms/SimplifyCFG/X86/2010-03-30-InvokeCrash.ll
llvm/test/Transforms/SimplifyCFG/X86/bug-25299.ll
llvm/test/Transforms/SimplifyCFG/X86/empty-cleanuppad.ll
llvm/test/Transforms/SimplifyCFG/empty-catchpad.ll
llvm/test/Transforms/SimplifyCFG/invoke_unwind.ll
llvm/test/Transforms/SimplifyCFG/invoke_unwind_lifetime.ll
llvm/test/Transforms/SimplifyCFG/lifetime-landingpad.ll
llvm/test/Transforms/SimplifyCFG/wineh-unreachable.ll

index b0373c6..d7368ef 100644 (file)
@@ -1,21 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
 
-; CHECK-NOT: invoke
-; CHECK-NOT: landingpad
 
 declare void @bar()
 
 define i32 @foo() personality ptr @__gxx_personality_v0 {
+; CHECK-LABEL: @foo(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    call void @bar()
+; CHECK-NEXT:    ret i32 0
+;
 entry:
   invoke void @bar()
-          to label %return unwind label %lpad
+  to label %return unwind label %lpad
 
 return:
   ret i32 0
 
 lpad:
   %lp = landingpad { ptr, i32 }
-          cleanup
+  cleanup
   resume { ptr, i32 } %lp
 }
 
index a9fb464..94d1fa5 100644 (file)
@@ -1,4 +1,4 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1  -S | FileCheck %s
 
 define void @test1(i1 %C, ptr %BP) {
@@ -566,3 +566,8 @@ else:
 
 
 attributes #0 = { null_pointer_is_valid }
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
+; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
+; CHECK: attributes #[[ATTR2:[0-9]+]] = { null_pointer_is_valid }
+;.
index 5305d31..dacd2dd 100644 (file)
@@ -1,22 +1,28 @@
-; RUN: opt -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output < %s
-; END.
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
+; RUN: opt -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s -S | FileCheck %s
+
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 target triple = "x86_64-unknown-linux-gnu"
 
 declare void @bar(i32)
 
 define void @foo() personality ptr @__gxx_personality_v0 {
+; CHECK-LABEL: @foo(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    call void @bar(i32 undef)
+; CHECK-NEXT:    ret void
+;
 entry:
- invoke void @bar(i32 undef)
-         to label %r unwind label %u
 invoke void @bar(i32 undef)
+  to label %r unwind label %u
 
 r:                                                ; preds = %entry
- ret void
 ret void
 
 u:                                                ; preds = %entry
- %val = landingpad { ptr, i32 }
-          cleanup
- resume { ptr, i32 } %val
 %val = landingpad { ptr, i32 }
+  cleanup
 resume { ptr, i32 } %val
 }
 
 declare i32 @__gxx_personality_v0(...)
index f72e583..da5c976 100644 (file)
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
 
 ;; Test case for bug 25299, contributed by David Majnemer.
@@ -6,15 +7,21 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 define void @f(i1 %B) personality i1 undef {
+; CHECK-LABEL: @f(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    call void @g()
+; CHECK-NEXT:    br label [[CONTINUE:%.*]]
+; CHECK:       continue:
+; CHECK-NEXT:    call void @g()
+; CHECK-NEXT:    br label [[CONTINUE]]
+;
 entry:
-;CHECK: entry
-;CHECK-NEXT: call void @g()
   invoke void @g()
-          to label %continue unwind label %unwind
+  to label %continue unwind label %unwind
 
 unwind:                                           ; preds = %entry
   %tmp101 = landingpad { ptr, i32 }
-          cleanup
+  cleanup
   br i1 %B, label %resume, label %then
 
 then:                                             ; preds = %cleanup1
@@ -22,18 +29,15 @@ then:                                             ; preds = %cleanup1
 
 resume:                                           ; preds = %cleanup2, %then, %cleanup1, %unwind
   %tmp104 = phi { ptr, i32 } [ %tmp101, %then ], [ %tmp106, %cleanup2 ], [ %tmp101, %unwind ]
-;CHECK-NOT: resume { ptr, i32 } %tmp104
   resume { ptr, i32 } %tmp104
 
 continue:                                         ; preds = %entry, %continue
-;CHECK: continue:                                         ; preds = %entry, %continue
-;CHECK-NEXT: call void @g()
   invoke void @g()
-          to label %continue unwind label %cleanup2
+  to label %continue unwind label %cleanup2
 
 cleanup2:                                         ; preds = %continue
   %tmp106 = landingpad { ptr, i32 }
-          cleanup
+  cleanup
   br label %resume
 }
 
index cd102d3..7e86b34 100644 (file)
@@ -1,4 +1,4 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -hoist-common-insts=true | FileCheck %s
 
 ; ModuleID = 'cppeh-simplify.cpp'
@@ -557,3 +557,6 @@ declare i32 @__CxxFrameHandler3(...)
 
 declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
 declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
+;.
index 292c6c9..767817b 100644 (file)
@@ -1,4 +1,4 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
 
 declare void @f()
@@ -154,3 +154,6 @@ cleanup:
 exit:
   ret void
 }
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind }
+;.
index d8da782..32ec9b2 100644 (file)
@@ -1,4 +1,4 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
 
 declare void @bar()
@@ -7,7 +7,7 @@ declare void @bar()
 ; instructions to call instructions if the handler just rethrows the exception.
 define i32 @test1() personality ptr @__gxx_personality_v0 {
 ; CHECK-LABEL: @test1(
-; CHECK-NEXT:    call void @bar(), !prof !0
+; CHECK-NEXT:    call void @bar(), !prof [[PROF0:![0-9]+]]
 ; CHECK-NEXT:    ret i32 0
 ;
   invoke void @bar( )
@@ -87,3 +87,6 @@ lpad2:
 }
 
 declare i32 @__gxx_personality_v0(...)
+;.
+; CHECK: [[PROF0]] = !{!"branch_weights", i32 371}
+;.
index 7cc2e1b..ff031e9 100644 (file)
@@ -1,4 +1,4 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
 
 declare void @llvm.lifetime.start.p0(i64, ptr)
@@ -80,3 +80,6 @@ end:
   call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i11)
   resume { ptr, i32 } %i10
 }
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
+;.
index 036b908..0174eb1 100644 (file)
@@ -1,13 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
 
-; CHECK-LABEL: define void @foo
 define void @foo() personality ptr @__gxx_personality_v0 {
+; CHECK-LABEL: @foo(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[A:%.*]] = alloca i8, align 1
+; CHECK-NEXT:    call void @llvm.lifetime.start.p0(i64 1, ptr nonnull [[A]]) #[[ATTR1:[0-9]+]]
+; CHECK-NEXT:    call void @bar()
+; CHECK-NEXT:    call void @llvm.lifetime.end.p0(i64 1, ptr nonnull [[A]]) #[[ATTR1]]
+; CHECK-NEXT:    ret void
+;
 entry:
-; CHECK: alloca i8
-; CHECK: call void @llvm.lifetime.start.p0
-; CHECK: call void @bar()
-; CHECK: call void @llvm.lifetime.end.p0
-; CHECK: ret void
   %a = alloca i8
   call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) nounwind
   invoke void @bar() to label %invoke.cont unwind label %lpad
@@ -17,9 +20,8 @@ invoke.cont:
   ret void
 
 lpad:
-; CHECK-NOT: landingpad
   %b = landingpad { ptr, i32 }
-          cleanup
+  cleanup
   call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) nounwind
   resume { ptr, i32 } %b
 }
@@ -31,3 +33,7 @@ declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) nounwind
 declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) nounwind
 
 declare i32 @__gxx_personality_v0(...)
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
+; CHECK: attributes #[[ATTR1]] = { nounwind }
+;.
index 853d65d..9828db2 100644 (file)
@@ -1,4 +1,4 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
 ; RUN: opt -S -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
 
 declare void @Personality()