From 6e54db0852b108e0314bb1d126741693fc4e10a6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 14 Nov 2004 19:12:17 +0000 Subject: 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 --- test/Transforms/InstCombine/phi.ll | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/Transforms/InstCombine/phi.ll') 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 +} + -- cgit v1.2.3