Chris Lattner | 5cc924a | 2005-05-07 04:23:29 +0000 | [diff] [blame] | 1 | ; With shl->mul reassociation, we can see that this is (shl A, 9) * A |
| 2 | ; |
Dan Gohman | f2f6ce6 | 2009-09-11 18:01:28 +0000 | [diff] [blame] | 3 | ; RUN: opt < %s -reassociate -instcombine -S |\ |
Chandler Carruth | 4177e6f | 2012-07-02 12:47:22 +0000 | [diff] [blame] | 4 | ; RUN: grep "shl .*, 9" |
Chris Lattner | 5cc924a | 2005-05-07 04:23:29 +0000 | [diff] [blame] | 5 | |
Tanya Lattner | 7f40dea | 2008-03-19 04:36:04 +0000 | [diff] [blame] | 6 | define i32 @test(i32 %A, i32 %B) { |
| 7 | %X = shl i32 %A, 5 ; <i32> [#uses=1] |
| 8 | %Y = shl i32 %A, 4 ; <i32> [#uses=1] |
| 9 | %Z = mul i32 %Y, %X ; <i32> [#uses=1] |
| 10 | ret i32 %Z |
Chris Lattner | 5cc924a | 2005-05-07 04:23:29 +0000 | [diff] [blame] | 11 | } |
Tanya Lattner | 7f40dea | 2008-03-19 04:36:04 +0000 | [diff] [blame] | 12 | |