diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-10-11 21:29:45 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-10-11 21:29:45 +0000 |
| commit | d2c58366d8d3205f212f026fe373641eebccaebb (patch) | |
| tree | f29e1be9204f79476578dfd4aa8f30d0a3a57145 /test/Transforms | |
| parent | 0036e3a4698d947c455e755faafe5c83a9c3b9c6 (diff) | |
generalize a transformation even more: we don't care whether the
input the the mul is a zext from bool, just that it is all zeros
other than the low bit. This fixes some phase ordering issues
that would cause us to miss some xforms in mul.ll when the worklist
is visited differently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
| -rw-r--r-- | test/Transforms/InstCombine/mul.ll | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/mul.ll b/test/Transforms/InstCombine/mul.ll index d8e623c483..53a56434ae 100644 --- a/test/Transforms/InstCombine/mul.ll +++ b/test/Transforms/InstCombine/mul.ll @@ -105,5 +105,12 @@ define i32 @test16(i32 %b, i1 %c) { ret i32 %e } +; X * Y (when Y is 0 or 1) --> x & (0-Y) +define i32 @test17(i32 %a, i32 %b) { + %a.lobit = lshr i32 %a, 31 + %e = mul i32 %a.lobit, %b + ret i32 %e +} + |
