diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-12-14 08:46:09 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-12-14 08:46:09 +0000 |
| commit | 7499b452c1425359ae19e12adcfbbe7f1de2823e (patch) | |
| tree | f3f5c26515ebbcc86ac65601b8edf7d3ca139c70 /llvm/test/Transforms/SimplifyCFG | |
| parent | db40c7f57326f6c6f08e0b9e397dd2aff98c4c3a (diff) | |
| download | bcm5719-llvm-7499b452c1425359ae19e12adcfbbe7f1de2823e.tar.gz bcm5719-llvm-7499b452c1425359ae19e12adcfbbe7f1de2823e.zip | |
- Insert new instructions before DomBlock's terminator,
which is simpler than finding a place to insert in BB.
- Don't perform the 'if condition hoisting' xform on certain
i1 PHIs, as it interferes with switch formation.
This re-fixes "example 7", without breaking the world hopefully.
llvm-svn: 121764
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG')
| -rw-r--r-- | llvm/test/Transforms/SimplifyCFG/PhiEliminate.ll | 14 | ||||
| -rw-r--r-- | llvm/test/Transforms/SimplifyCFG/switch_create.ll | 32 |
2 files changed, 16 insertions, 30 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/PhiEliminate.ll b/llvm/test/Transforms/SimplifyCFG/PhiEliminate.ll index 73cf466a4f7..d5ce9a7e6bc 100644 --- a/llvm/test/Transforms/SimplifyCFG/PhiEliminate.ll +++ b/llvm/test/Transforms/SimplifyCFG/PhiEliminate.ll @@ -11,20 +11,6 @@ declare void @use(i1) declare void @use.upgrd.1(i32) -define void @test2(i1 %c, i1 %d, i32 %V, i32 %V2) { -; <label>:0 - br i1 %d, label %X, label %F -X: ; preds = %0 - br i1 %c, label %T, label %F -T: ; preds = %X - br label %F -F: ; preds = %T, %X, %0 - %B1 = phi i1 [ true, %0 ], [ false, %T ], [ false, %X ] ; <i1> [#uses=1] - %I7 = phi i32 [ %V, %0 ], [ %V2, %T ], [ %V2, %X ] ; <i32> [#uses=1] - call void @use( i1 %B1 ) - call void @use.upgrd.1( i32 %I7 ) - ret void -} define void @test(i1 %c, i32 %V, i32 %V2) { ; <label>:0 diff --git a/llvm/test/Transforms/SimplifyCFG/switch_create.ll b/llvm/test/Transforms/SimplifyCFG/switch_create.ll index 8d051b49f0b..0169eb7039f 100644 --- a/llvm/test/Transforms/SimplifyCFG/switch_create.ll +++ b/llvm/test/Transforms/SimplifyCFG/switch_create.ll @@ -253,21 +253,21 @@ lor.end: ; preds = %lor.rhs, %lor.lhs.f ret i32 %conv46 ; CHECK: @test9 -; HECK: %cmp = icmp ult i8 %c, 33 -; HECK: br i1 %cmp, label %lor.end, label %switch.early.test - -; HECK: switch.early.test: -; HECK: switch i8 %c, label %lor.rhs [ -; HECK: i8 46, label %lor.end -; HECK: i8 44, label %lor.end -; HECK: i8 58, label %lor.end -; HECK: i8 59, label %lor.end -; HECK: i8 60, label %lor.end -; HECK: i8 62, label %lor.end -; HECK: i8 34, label %lor.end -; HECK: i8 92, label %lor.end -; HECK: i8 39, label %lor.end -; HECK: ] +; CHECK: %cmp = icmp ult i8 %c, 33 +; CHECK: br i1 %cmp, label %lor.end, label %switch.early.test + +; CHECK: switch.early.test: +; CHECK: switch i8 %c, label %lor.rhs [ +; CHECK: i8 92, label %lor.end +; CHECK: i8 62, label %lor.end +; CHECK: i8 60, label %lor.end +; CHECK: i8 59, label %lor.end +; CHECK: i8 58, label %lor.end +; CHECK: i8 46, label %lor.end +; CHECK: i8 44, label %lor.end +; CHECK: i8 34, label %lor.end +; CHECK: i8 39, label %lor.end +; CHECK: ] } define i32 @test10(i32 %mode, i1 %Cond) { @@ -351,4 +351,4 @@ malformed: ret void ; CHECK: @test12 -} +}
\ No newline at end of file |

