diff options
| author | Dan Gohman <gohman@apple.com> | 2009-10-30 23:16:10 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-10-30 23:16:10 +0000 |
| commit | 56998cdc5b2da7cb692525c1c9990e1d5e8e78f2 (patch) | |
| tree | ca2c119f35eda9df14d51e5181378a70515efb55 /llvm | |
| parent | 7f7d97eb73d4aa243646583301c943b1f125bade (diff) | |
| download | bcm5719-llvm-56998cdc5b2da7cb692525c1c9990e1d5e8e78f2.tar.gz bcm5719-llvm-56998cdc5b2da7cb692525c1c9990e1d5e8e78f2.zip | |
Add a testcase for the recent duplicate PHI elimination changes.
llvm-svn: 85636
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/test/Transforms/SimplifyCFG/duplicate-phis.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/duplicate-phis.ll b/llvm/test/Transforms/SimplifyCFG/duplicate-phis.ll new file mode 100644 index 00000000000..a1e51139800 --- /dev/null +++ b/llvm/test/Transforms/SimplifyCFG/duplicate-phis.ll @@ -0,0 +1,21 @@ +; RUN: opt < %s -instcombine -simplifycfg -S | grep { = phi } | count 1 + +; instcombine should sort the PHI operands so that simplifycfg can see the +; duplicate and remove it. + +define i32 @foo(i1 %t) { +entry: + call void @bar() + br i1 %t, label %true, label %false, +true: + call void @bar() + br label %false +false: + %a = phi i32 [ 2, %true ], [ 5, %entry ] + %b = phi i32 [ 5, %entry ], [ 2, %true ] + call void @bar() + %c = add i32 %a, %b + ret i32 %c +} + +declare void @bar() |

