summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SimplifyCFG/switch-masked-bits.ll
diff options
context:
space:
mode:
authorShawn Landden <shawn@git.icu>2019-05-26 13:52:41 +0000
committerShawn Landden <shawn@git.icu>2019-05-26 13:52:41 +0000
commit50c73a044f22e97ea384c461bcdd2ea4fbed0156 (patch)
tree1d109d8525688ead078843e158d760e62ea19d82 /llvm/test/Transforms/SimplifyCFG/switch-masked-bits.ll
parentb7cc093db28cf6d20b35092c4108bc8aa15cc011 (diff)
downloadbcm5719-llvm-50c73a044f22e97ea384c461bcdd2ea4fbed0156.tar.gz
bcm5719-llvm-50c73a044f22e97ea384c461bcdd2ea4fbed0156.zip
[SimplifyCFG] NFC, update Switch tests to HEAD so I can see if my changes change anything
Also add baseline tests to show effect of later patches. llvm-svn: 361725
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG/switch-masked-bits.ll')
-rw-r--r--llvm/test/Transforms/SimplifyCFG/switch-masked-bits.ll23
1 files changed, 15 insertions, 8 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/switch-masked-bits.ll b/llvm/test/Transforms/SimplifyCFG/switch-masked-bits.ll
index 2d46aac23f6..21cecc5c942 100644
--- a/llvm/test/Transforms/SimplifyCFG/switch-masked-bits.ll
+++ b/llvm/test/Transforms/SimplifyCFG/switch-masked-bits.ll
@@ -4,10 +4,10 @@
define i32 @test1(i32 %x) nounwind {
; CHECK-LABEL: @test1(
; CHECK-NEXT: a:
-; CHECK-NEXT: [[I:%.*]] = shl i32 %x, 1
+; CHECK-NEXT: [[I:%.*]] = shl i32 [[X:%.*]], 1
; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 [[I]], 24
-; CHECK-NEXT: [[DOT:%.*]] = select i1 [[COND]], i32 5, i32 0
-; CHECK-NEXT: ret i32 [[DOT]]
+; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[COND]], i32 5, i32 0
+; CHECK-NEXT: ret i32 [[SPEC_SELECT]]
;
%i = shl i32 %x, 1
switch i32 %i, label %a [
@@ -48,12 +48,19 @@ c:
define i1 @repeated_signbits(i8 %condition) {
; CHECK-LABEL: @repeated_signbits(
-; CHECK: switch i32
-; CHECK-DAG: i32 -128, label %a
-; CHECK-DAG: i32 -1, label %a
-; CHECK-DAG: i32 0, label %a
-; CHECK-DAG: i32 127, label %a
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[SEXT:%.*]] = sext i8 [[CONDITION:%.*]] to i32
+; CHECK-NEXT: switch i32 [[SEXT]], label [[DEFAULT:%.*]] [
+; CHECK-NEXT: i32 0, label [[A:%.*]]
+; CHECK-NEXT: i32 127, label [[A]]
+; CHECK-NEXT: i32 -128, label [[A]]
+; CHECK-NEXT: i32 -1, label [[A]]
; CHECK-NEXT: ]
+; CHECK: a:
+; CHECK-NEXT: [[MERGE:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ true, [[ENTRY]] ], [ true, [[ENTRY]] ], [ true, [[ENTRY]] ], [ false, [[DEFAULT]] ]
+; CHECK-NEXT: ret i1 [[MERGE]]
+; CHECK: default:
+; CHECK-NEXT: br label [[A]]
;
entry:
%sext = sext i8 %condition to i32
OpenPOWER on IntegriCloud