diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-24 18:15:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-24 18:15:30 +0000 |
commit | 4f9797d683156bc5b59f5be66d0c01a369935ba1 (patch) | |
tree | 82b5a2e75f2964565e2b7da2dfe13328171026f1 /test/Transforms/InstCombine/shift.ll | |
parent | e330ae5b32fa5f798894cec207fd9e4fcc578382 (diff) | |
download | llvm-4f9797d683156bc5b59f5be66d0c01a369935ba1.tar.gz llvm-4f9797d683156bc5b59f5be66d0c01a369935ba1.tar.bz2 llvm-4f9797d683156bc5b59f5be66d0c01a369935ba1.tar.xz |
two changes:
1. Make instcombine always canonicalize trunc x to i1 into an icmp(x&1). This
exposes the AND to other instcombine xforms and is more of what the code
generator expects.
2. Rewrite the remaining trunc pattern match to use 'match', which
simplifies it a lot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/shift.ll')
-rw-r--r-- | test/Transforms/InstCombine/shift.ll | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/shift.ll b/test/Transforms/InstCombine/shift.ll index e17fd35fe4..9dc7755c1b 100644 --- a/test/Transforms/InstCombine/shift.ll +++ b/test/Transforms/InstCombine/shift.ll @@ -206,4 +206,11 @@ define i32 @test26(i32 %A) { %D = shl i32 %C, 1 ; <i32> [#uses=1] ret i32 %D } + + +define i1 @test27(i32 %x) nounwind { + %y = lshr i32 %x, 3 + %z = trunc i32 %y to i1 + ret i1 %z +} |