[llvm] r264677 - regenerate checks
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 28 15:12:22 PDT 2016
Author: spatel
Date: Mon Mar 28 17:12:21 2016
New Revision: 264677
URL: http://llvm.org/viewvc/llvm-project?rev=264677&view=rev
Log:
regenerate checks
Modified:
llvm/trunk/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll
llvm/trunk/test/Transforms/SimplifyCFG/PR16069.ll
llvm/trunk/test/Transforms/SimplifyCFG/PhiBlockMerge.ll
Modified: llvm/trunk/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll?rev=264677&r1=264676&r2=264677&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll Mon Mar 28 17:12:21 2016
@@ -1,81 +1,104 @@
+; NOTE: Assertions have been autogenerated by update_test_checks.py
; RUN: opt < %s -simplifycfg -S | FileCheck %s
-; CHECK-NOT: switch
-
; Test normal folding
define i32 @test1() {
- switch i32 5, label %Default [
- i32 0, label %Foo
- i32 1, label %Bar
- i32 2, label %Baz
- i32 5, label %TheDest
- ]
-Default: ; preds = %0
- ret i32 -1
-Foo: ; preds = %0
- ret i32 -2
-Bar: ; preds = %0
- ret i32 -3
-Baz: ; preds = %0
- ret i32 -4
-TheDest: ; preds = %0
- ret i32 1234
+; CHECK-LABEL: @test1(
+; CHECK-NEXT: TheDest:
+; CHECK-NEXT: ret i32 1234
+;
+ switch i32 5, label %Default [
+ i32 0, label %Foo
+ i32 1, label %Bar
+ i32 2, label %Baz
+ i32 5, label %TheDest
+ ]
+Default:
+ ret i32 -1
+Foo:
+ ret i32 -2
+Bar:
+ ret i32 -3
+Baz:
+ ret i32 -4
+TheDest:
+ ret i32 1234
}
; Test folding to default dest
define i32 @test2() {
- switch i32 3, label %Default [
- i32 0, label %Foo
- i32 1, label %Bar
- i32 2, label %Baz
- i32 5, label %TheDest
- ]
-Default: ; preds = %0
- ret i32 1234
-Foo: ; preds = %0
- ret i32 -2
-Bar: ; preds = %0
- ret i32 -5
-Baz: ; preds = %0
- ret i32 -6
-TheDest: ; preds = %0
- ret i32 -8
+; CHECK-LABEL: @test2(
+; CHECK-NEXT: Default:
+; CHECK-NEXT: ret i32 1234
+;
+ switch i32 3, label %Default [
+ i32 0, label %Foo
+ i32 1, label %Bar
+ i32 2, label %Baz
+ i32 5, label %TheDest
+ ]
+Default:
+ ret i32 1234
+Foo:
+ ret i32 -2
+Bar:
+ ret i32 -5
+Baz:
+ ret i32 -6
+TheDest:
+ ret i32 -8
}
; Test folding all to same dest
define i32 @test3(i1 %C) {
- br i1 %C, label %Start, label %TheDest
+; CHECK-LABEL: @test3(
+; CHECK-NEXT: TheDest:
+; CHECK-NEXT: ret i32 1234
+;
+ br i1 %C, label %Start, label %TheDest
Start: ; preds = %0
- switch i32 3, label %TheDest [
- i32 0, label %TheDest
- i32 1, label %TheDest
- i32 2, label %TheDest
- i32 5, label %TheDest
- ]
-TheDest: ; preds = %Start, %Start, %Start, %Start, %Start, %0
- ret i32 1234
+ switch i32 3, label %TheDest [
+ i32 0, label %TheDest
+ i32 1, label %TheDest
+ i32 2, label %TheDest
+ i32 5, label %TheDest
+ ]
+TheDest:
+ ret i32 1234
}
; Test folding switch -> branch
define i32 @test4(i32 %C) {
- switch i32 %C, label %L1 [
- i32 0, label %L2
- ]
-L1: ; preds = %0
- ret i32 0
-L2: ; preds = %0
- ret i32 1
+; CHECK-LABEL: @test4(
+; CHECK-NEXT: L1:
+; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 %C, 0
+; CHECK-NEXT: [[DOT:%.*]] = select i1 [[COND]], i32 1, i32 0
+; CHECK-NEXT: ret i32 [[DOT]]
+;
+ switch i32 %C, label %L1 [
+ i32 0, label %L2
+ ]
+L1:
+ ret i32 0
+L2:
+ ret i32 1
}
; Can fold into a cond branch!
define i32 @test5(i32 %C) {
- switch i32 %C, label %L1 [
- i32 0, label %L2
- i32 123, label %L1
- ]
-L1: ; preds = %0, %0
- ret i32 0
-L2: ; preds = %0
- ret i32 1
+; CHECK-LABEL: @test5(
+; CHECK-NEXT: L1:
+; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 %C, 0
+; CHECK-NEXT: [[DOT:%.*]] = select i1 [[COND]], i32 1, i32 0
+; CHECK-NEXT: ret i32 [[DOT]]
+;
+ switch i32 %C, label %L1 [
+ i32 0, label %L2
+ i32 123, label %L1
+ ]
+L1:
+ ret i32 0
+L2:
+ ret i32 1
}
Modified: llvm/trunk/test/Transforms/SimplifyCFG/PR16069.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/PR16069.ll?rev=264677&r1=264676&r2=264677&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyCFG/PR16069.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyCFG/PR16069.ll Mon Mar 28 17:12:21 2016
@@ -1,9 +1,13 @@
+; NOTE: Assertions have been autogenerated by update_test_checks.py
; RUN: opt < %s -simplifycfg -S | FileCheck %s
@b = extern_weak global i32
define i32 @foo(i1 %y) {
-; CHECK: define i32 @foo(i1 %y) {
+; CHECK-LABEL: @foo(
+; CHECK: [[COND_I:%.*]] = phi i32 [ srem (i32 1, i32 zext (i1 icmp eq (i32* @b, i32* null) to i32)), %bb2 ], [ 0, %0 ]
+; CHECK-NEXT: ret i32 [[COND_I]]
+;
br i1 %y, label %bb1, label %bb2
bb1:
br label %bb3
@@ -11,18 +15,19 @@ bb2:
br label %bb3
bb3:
%cond.i = phi i32 [ 0, %bb1 ], [ srem (i32 1, i32 zext (i1 icmp eq (i32* @b, i32* null) to i32)), %bb2 ]
-; CHECK: phi i32 {{.*}} srem (i32 1, i32 zext (i1 icmp eq (i32* @b, i32* null) to i32)), %bb2
ret i32 %cond.i
}
define i32 @foo2(i1 %x) {
-; CHECK: define i32 @foo2(i1 %x) {
+; CHECK-LABEL: @foo2(
+; CHECK: [[COND:%.*]] = phi i32 [ 0, %bb1 ], [ srem (i32 1, i32 zext (i1 icmp eq (i32* @b, i32* null) to i32)), %bb0 ]
+; CHECK-NEXT: ret i32 [[COND]]
+;
bb0:
br i1 %x, label %bb1, label %bb2
bb1:
br label %bb2
bb2:
%cond = phi i32 [ 0, %bb1 ], [ srem (i32 1, i32 zext (i1 icmp eq (i32* @b, i32* null) to i32)), %bb0 ]
-; CHECK: %cond = phi i32 [ 0, %bb1 ], [ srem (i32 1, i32 zext (i1 icmp eq (i32* @b, i32* null) to i32)), %bb0 ]
ret i32 %cond
}
Modified: llvm/trunk/test/Transforms/SimplifyCFG/PhiBlockMerge.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/PhiBlockMerge.ll?rev=264677&r1=264676&r2=264677&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyCFG/PhiBlockMerge.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyCFG/PhiBlockMerge.ll Mon Mar 28 17:12:21 2016
@@ -1,24 +1,29 @@
+; NOTE: Assertions have been autogenerated by update_test_checks.py
; Test merging of blocks that only have PHI nodes in them
;
; RUN: opt < %s -simplifycfg -S | FileCheck %s
;
define i32 @test(i1 %a, i1 %b) {
- br i1 %a, label %M, label %O
+; CHECK-LABEL: @test(
+; CHECK: M:
+; CHECK-NEXT: [[DOT:%.*]] = select i1 %b, i32 0, i32 1
+; CHECK-NEXT: [[W:%.*]] = select i1 %a, i32 2, i32 [[DOT]]
+; CHECK-NEXT: [[R:%.*]] = add i32 [[W]], 1
+; CHECK-NEXT: ret i32 [[R]]
+;
+ br i1 %a, label %M, label %O
O: ; preds = %0
-; CHECK: select i1 %b, i32 0, i32 1
-; CHECK-NOT: phi
- br i1 %b, label %N, label %Q
+ br i1 %b, label %N, label %Q
Q: ; preds = %O
- br label %N
+ br label %N
N: ; preds = %Q, %O
- ; This block should be foldable into M
- %Wp = phi i32 [ 0, %O ], [ 1, %Q ] ; <i32> [#uses=1]
- br label %M
+ ; This block should be foldable into M
+ %Wp = phi i32 [ 0, %O ], [ 1, %Q ] ; <i32> [#uses=1]
+ br label %M
M: ; preds = %N, %0
- %W = phi i32 [ %Wp, %N ], [ 2, %0 ] ; <i32> [#uses=1]
- %R = add i32 %W, 1 ; <i32> [#uses=1]
- ret i32 %R
-; CHECK: ret
+ %W = phi i32 [ %Wp, %N ], [ 2, %0 ] ; <i32> [#uses=1]
+ %R = add i32 %W, 1 ; <i32> [#uses=1]
+ ret i32 %R
}
More information about the llvm-commits
mailing list