blob: f103e7c0df06340bcf27319a976be371e3fae0fc [file] [log] [blame]
Tanya Lattner348c6182008-03-25 04:26:08 +00001; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; RUN: grep slwi %t
3; RUN: not grep addi %t
4; RUN: not grep rlwinm %t
5
Tanya Lattner348c6182008-03-25 04:26:08 +00006define i32 @test(i32 %A) {
7 ;; shift
8 %B = mul i32 %A, 8 ; <i32> [#uses=1]
9 ;; dead, no demanded bits.
10 %C = add i32 %B, 7 ; <i32> [#uses=1]
11 ;; dead once add is gone.
12 %D = and i32 %C, -8 ; <i32> [#uses=1]
13 ret i32 %D
Dan Gohmanf17a25c2007-07-18 16:29:46 +000014}
15