summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SimplifyCFG/switch_switch_fold.ll
diff options
context:
space:
mode:
authorShawn Landden <shawn@git.icu>2019-06-13 04:51:35 +0000
committerShawn Landden <shawn@git.icu>2019-06-13 04:51:35 +0000
commitc54b2011bd0791260e049b0acabd63cf1438aa95 (patch)
tree76b8430512ce77e34650419ed1271d54fc822dad /llvm/test/Transforms/SimplifyCFG/switch_switch_fold.ll
parentc2e2df7f7af139ff2edb0563bfe48896d841c5e2 (diff)
downloadbcm5719-llvm-c54b2011bd0791260e049b0acabd63cf1438aa95.tar.gz
bcm5719-llvm-c54b2011bd0791260e049b0acabd63cf1438aa95.zip
[SimplifyCFG] NFC, update Switch tests to better examine successive patches
Also add baseline tests to show effect of later patches. There were a couple of regressions here that were never caught, but my patch set that this is a preparation to will fix them. Differential Revision: https://reviews.llvm.org/D61150 llvm-svn: 363226
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG/switch_switch_fold.ll')
-rw-r--r--llvm/test/Transforms/SimplifyCFG/switch_switch_fold.ll76
1 files changed, 39 insertions, 37 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/switch_switch_fold.ll b/llvm/test/Transforms/SimplifyCFG/switch_switch_fold.ll
index 7f6f1c94bd4..0df40349c1b 100644
--- a/llvm/test/Transforms/SimplifyCFG/switch_switch_fold.ll
+++ b/llvm/test/Transforms/SimplifyCFG/switch_switch_fold.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; Test that a switch going to a switch on the same value can be merged.
@@ -12,43 +13,12 @@ declare void @foo3()
declare void @foo4()
define void @test1(i32 %V) {
- switch i32 %V, label %F [
- i32 4, label %T
- i32 17, label %T
- i32 5, label %T
- i32 1234, label %F
- ]
-T: ; preds = %0, %0, %0
- switch i32 %V, label %F [
- i32 4, label %A
- i32 17, label %B
- i32 42, label %C
- ]
-A: ; preds = %T
- call void @foo1( )
- ret void
-B: ; preds = %F, %F, %T
- call void @foo2( )
- ret void
-C: ; preds = %T
- call void @foo3( )
- ret void
-F: ; preds = %F, %T, %0, %0
- switch i32 %V, label %F [
- i32 4, label %B
- i32 18, label %B
- i32 42, label %D
- ]
-D: ; preds = %F
- call void @foo4( )
- ret void
-
; CHECK-LABEL: @test1(
-; CHECK-NEXT: switch i32 %V, label %infloop [
-; CHECK-NEXT: i32 4, label %A
-; CHECK-NEXT: i32 17, label %B
-; CHECK-NEXT: i32 18, label %B
-; CHECK-NEXT: i32 42, label %D
+; CHECK-NEXT: switch i32 [[V:%.*]], label [[INFLOOP:%.*]] [
+; CHECK-NEXT: i32 4, label [[A:%.*]]
+; CHECK-NEXT: i32 17, label [[B:%.*]]
+; CHECK-NEXT: i32 18, label [[B]]
+; CHECK-NEXT: i32 42, label [[D:%.*]]
; CHECK-NEXT: ]
; CHECK: A:
; CHECK-NEXT: call void @foo1()
@@ -60,6 +30,38 @@ D: ; preds = %F
; CHECK-NEXT: call void @foo4()
; CHECK-NEXT: ret void
; CHECK: infloop:
-; CHECK-NEXT: br label %infloop
+; CHECK-NEXT: br label [[INFLOOP]]
+;
+ switch i32 %V, label %F [
+ i32 4, label %T
+ i32 17, label %T
+ i32 5, label %T
+ i32 1234, label %F
+ ]
+T: ; preds = %0, %0, %0
+ switch i32 %V, label %F [
+ i32 4, label %A
+ i32 17, label %B
+ i32 42, label %C
+ ]
+A: ; preds = %T
+ call void @foo1( )
+ ret void
+B: ; preds = %F, %F, %T
+ call void @foo2( )
+ ret void
+C: ; preds = %T
+ call void @foo3( )
+ ret void
+F: ; preds = %F, %T, %0, %0
+ switch i32 %V, label %F [
+ i32 4, label %B
+ i32 18, label %B
+ i32 42, label %D
+ ]
+D: ; preds = %F
+ call void @foo4( )
+ ret void
+
}
OpenPOWER on IntegriCloud