diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-14 19:12:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-14 19:12:17 +0000 |
commit | 6e54db0852b108e0314bb1d126741693fc4e10a6 (patch) | |
tree | 0a2c09a8aee1513a6fb5d1e5c7d9c44bdfe2cb37 | |
parent | e58b25490b8e549e1a5b252d3f9dc1095fd68dc8 (diff) | |
download | llvm-6e54db0852b108e0314bb1d126741693fc4e10a6.tar.gz llvm-6e54db0852b108e0314bb1d126741693fc4e10a6.tar.bz2 llvm-6e54db0852b108e0314bb1d126741693fc4e10a6.tar.xz |
New testcase: the phi can be eliminated if the casts are sucked into it.
Note that this reduces code size anyway (as well as making further
optimizations simpler) so it's always a win.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17739 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Transforms/InstCombine/phi.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/phi.ll b/test/Transforms/InstCombine/phi.ll index a15d341e3b..830c44f624 100644 --- a/test/Transforms/InstCombine/phi.ll +++ b/test/Transforms/InstCombine/phi.ll @@ -53,3 +53,15 @@ Exit: ret int %B } +uint %test6(int %A, bool %b) { +BB0: + %X = cast int %A to uint + br bool %b, label %BB1, label %BB2 +BB1: + %Y = cast int %A to uint + br label %BB2 +BB2: + %B = phi uint [%X, %BB0], [%Y, %BB1] ;; Suck casts into phi + ret uint %B +} + |