2005-05-07 12:23:29 +08:00
|
|
|
; With shl->mul reassociation, we can see that this is (shl A, 9) * A
|
|
|
|
;
|
2009-09-12 02:01:28 +08:00
|
|
|
; RUN: opt < %s -reassociate -instcombine -S |\
|
2007-04-15 17:21:47 +08:00
|
|
|
; RUN: grep {shl .*, 9}
|
2005-05-07 12:23:29 +08:00
|
|
|
|
2008-03-19 12:36:04 +08:00
|
|
|
define i32 @test(i32 %A, i32 %B) {
|
|
|
|
%X = shl i32 %A, 5 ; <i32> [#uses=1]
|
|
|
|
%Y = shl i32 %A, 4 ; <i32> [#uses=1]
|
|
|
|
%Z = mul i32 %Y, %X ; <i32> [#uses=1]
|
|
|
|
ret i32 %Z
|
2005-05-07 12:23:29 +08:00
|
|
|
}
|
2008-03-19 12:36:04 +08:00
|
|
|
|