blob: d9a5336fbfb493704424c1a73a1e8578fed2e20e [file] [log] [blame]
Chris Lattner5cc924a2005-05-07 04:23:29 +00001; With shl->mul reassociation, we can see that this is (shl A, 9) * A
2;
Dan Gohmanf2f6ce62009-09-11 18:01:28 +00003; RUN: opt < %s -reassociate -instcombine -S |\
Chandler Carruth4177e6f2012-07-02 12:47:22 +00004; RUN: grep "shl .*, 9"
Chris Lattner5cc924a2005-05-07 04:23:29 +00005
Tanya Lattner7f40dea2008-03-19 04:36:04 +00006define 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 Lattner5cc924a2005-05-07 04:23:29 +000011}
Tanya Lattner7f40dea2008-03-19 04:36:04 +000012