summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-11-25 21:12:39 +0000
committerSanjay Patel <spatel@rotateright.com>2016-11-25 21:12:39 +0000
commit534e270ae50391e4292dc0094b01d655122e1480 (patch)
tree9fb2a277953c139d178b6fddb3a2c464908f4788 /llvm/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll
parentd1a147f9f4b20fc42f5a95fa8f36d3cd9ab44a7a (diff)
downloadbcm5719-llvm-534e270ae50391e4292dc0094b01d655122e1480.tar.gz
bcm5719-llvm-534e270ae50391e4292dc0094b01d655122e1480.zip
[SimplifyCFG] auto-generate better checks; NFC
llvm-svn: 287954
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll')
-rw-r--r--llvm/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll24
1 files changed, 19 insertions, 5 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll b/llvm/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll
index f5359b5b2b3..bdc7017f4c7 100644
--- a/llvm/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll
+++ b/llvm/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll
@@ -16,9 +16,22 @@
; Function Attrs: nounwind
define i32 @fn1() {
-; CHECK-LABEL: @fn1
-; CHECK: %switch.selectcmp1 = icmp eq i32 %1, 5
-; CHECK: %switch.select2 = select i1 %switch.selectcmp1, i32 5, i32 %switch.select
+; CHECK-LABEL: @fn1(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @b, align 4
+; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0
+; CHECK-NEXT: br i1 [[TOBOOL]], label %return, label %if.then
+; CHECK: if.then:
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[SWITCH_SELECTCMP:%.*]] = icmp eq i32 [[TMP1]], 0
+; CHECK-NEXT: [[SWITCH_SELECT:%.*]] = select i1 [[SWITCH_SELECTCMP:%.*]], i32 0, i32 0
+; CHECK-NEXT: [[SWITCH_SELECTCMP1:%.*]] = icmp eq i32 [[TMP1]], 5
+; CHECK-NEXT: [[SWITCH_SELECT2:%.*]] = select i1 [[SWITCH_SELECTCMP1]], i32 5, i32 [[SWITCH_SELECT]]
+; CHECK-NEXT: br label %return
+; CHECK: return:
+; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[SWITCH_SELECT2]], %if.then ], [ 0, %entry ]
+; CHECK-NEXT: ret i32 [[RETVAL_0]]
+;
entry:
%0 = load i32, i32* @b, align 4
%tobool = icmp eq i32 %0, 0
@@ -27,8 +40,8 @@ entry:
if.then:
%1 = load i32, i32* @a, align 4
switch i32 %1, label %if.end3 [
- i32 5, label %return
- i32 0, label %return
+ i32 5, label %return
+ i32 0, label %return
]
if.end3:
@@ -38,3 +51,4 @@ return:
%retval.0 = phi i32 [ 0, %if.end3 ], [ %1, %if.then ], [ %1, %if.then ]
ret i32 %retval.0
}
+
OpenPOWER on IntegriCloud