[llvm] a5c23d5 - [NFC][SimplifyCFG] Autogenerate checklines in some tests that eliminate unwind edges
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 12 13:42:27 PST 2023
Author: Roman Lebedev
Date: 2023-01-13T00:41:58+03:00
New Revision: a5c23d55842a31eb83b7968866e69d1731411580
URL: https://github.com/llvm/llvm-project/commit/a5c23d55842a31eb83b7968866e69d1731411580
DIFF: https://github.com/llvm/llvm-project/commit/a5c23d55842a31eb83b7968866e69d1731411580.diff
LOG: [NFC][SimplifyCFG] Autogenerate checklines in some tests that eliminate unwind edges
Added:
Modified:
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
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SimplifyCFG/2011-09-05-TrivialLPad.ll b/llvm/test/Transforms/SimplifyCFG/2011-09-05-TrivialLPad.ll
index b0373c69605cb..d7368efa1eae6 100644
--- a/llvm/test/Transforms/SimplifyCFG/2011-09-05-TrivialLPad.ll
+++ b/llvm/test/Transforms/SimplifyCFG/2011-09-05-TrivialLPad.ll
@@ -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
}
diff --git a/llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll b/llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
index a9fb464f7a09b..94d1fa54159d7 100644
--- a/llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
+++ b/llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
@@ -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 }
+;.
diff --git a/llvm/test/Transforms/SimplifyCFG/X86/2010-03-30-InvokeCrash.ll b/llvm/test/Transforms/SimplifyCFG/X86/2010-03-30-InvokeCrash.ll
index 5305d31f498d2..dacd2ddc506a9 100644
--- a/llvm/test/Transforms/SimplifyCFG/X86/2010-03-30-InvokeCrash.ll
+++ b/llvm/test/Transforms/SimplifyCFG/X86/2010-03-30-InvokeCrash.ll
@@ -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(...)
diff --git a/llvm/test/Transforms/SimplifyCFG/X86/bug-25299.ll b/llvm/test/Transforms/SimplifyCFG/X86/bug-25299.ll
index f72e58392f9c7..da5c976873d72 100644
--- a/llvm/test/Transforms/SimplifyCFG/X86/bug-25299.ll
+++ b/llvm/test/Transforms/SimplifyCFG/X86/bug-25299.ll
@@ -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
}
diff --git a/llvm/test/Transforms/SimplifyCFG/X86/empty-cleanuppad.ll b/llvm/test/Transforms/SimplifyCFG/X86/empty-cleanuppad.ll
index cd102d3c4ee97..7e86b342ede22 100644
--- a/llvm/test/Transforms/SimplifyCFG/X86/empty-cleanuppad.ll
+++ b/llvm/test/Transforms/SimplifyCFG/X86/empty-cleanuppad.ll
@@ -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) }
+;.
diff --git a/llvm/test/Transforms/SimplifyCFG/empty-catchpad.ll b/llvm/test/Transforms/SimplifyCFG/empty-catchpad.ll
index 292c6c9822296..767817bf1c5d7 100644
--- a/llvm/test/Transforms/SimplifyCFG/empty-catchpad.ll
+++ b/llvm/test/Transforms/SimplifyCFG/empty-catchpad.ll
@@ -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 }
+;.
diff --git a/llvm/test/Transforms/SimplifyCFG/invoke_unwind.ll b/llvm/test/Transforms/SimplifyCFG/invoke_unwind.ll
index d8da7825c4416..32ec9b23ad2fe 100644
--- a/llvm/test/Transforms/SimplifyCFG/invoke_unwind.ll
+++ b/llvm/test/Transforms/SimplifyCFG/invoke_unwind.ll
@@ -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}
+;.
diff --git a/llvm/test/Transforms/SimplifyCFG/invoke_unwind_lifetime.ll b/llvm/test/Transforms/SimplifyCFG/invoke_unwind_lifetime.ll
index 7cc2e1b9690f6..ff031e95bc042 100644
--- a/llvm/test/Transforms/SimplifyCFG/invoke_unwind_lifetime.ll
+++ b/llvm/test/Transforms/SimplifyCFG/invoke_unwind_lifetime.ll
@@ -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) }
+;.
diff --git a/llvm/test/Transforms/SimplifyCFG/lifetime-landingpad.ll b/llvm/test/Transforms/SimplifyCFG/lifetime-landingpad.ll
index 036b908d15504..0174eb149581c 100644
--- a/llvm/test/Transforms/SimplifyCFG/lifetime-landingpad.ll
+++ b/llvm/test/Transforms/SimplifyCFG/lifetime-landingpad.ll
@@ -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 }
+;.
diff --git a/llvm/test/Transforms/SimplifyCFG/wineh-unreachable.ll b/llvm/test/Transforms/SimplifyCFG/wineh-unreachable.ll
index 853d65da548c4..9828db2a69853 100644
--- a/llvm/test/Transforms/SimplifyCFG/wineh-unreachable.ll
+++ b/llvm/test/Transforms/SimplifyCFG/wineh-unreachable.ll
@@ -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()
More information about the llvm-commits
mailing list