blob: 517e775172c3763253d7faa8540dc5ccad3a2571 [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s -march=ppc32 -o %t
Reid Spencereb1d74e2007-04-16 17:36:08 +00002; RUN: grep slwi %t
3; RUN: not grep addi %t
4; RUN: not grep rlwinm %t
Chris Lattnerf4f5f6b2006-03-13 06:50:47 +00005
Tanya Lattner6f729d62008-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
Chris Lattnerf4f5f6b2006-03-13 06:50:47 +000014}
15