blob: 035299e0ac824b560d52f2dfa45fa589f0941906 [file] [log] [blame]
Chandler Carrutha5839902007-08-06 20:57:16 +00001; PR1600
Dan Gohmanf2f6ce62009-09-11 18:01:28 +00002; RUN: opt < %s -basicaa -gvn -instcombine -S | \
Chandler Carrutha5839902007-08-06 20:57:16 +00003; RUN: grep {ret i32 0}
4; END.
5
6declare i16 @llvm.cttz.i16(i16)
7
8define i32 @test(i32* %P, i16* %Q) {
9 %A = load i16* %Q ; <i16> [#uses=1]
10 %x = load i32* %P ; <i32> [#uses=1]
11 %B = call i16 @llvm.cttz.i16( i16 %A ) ; <i16> [#uses=1]
12 %y = load i32* %P ; <i32> [#uses=1]
13 store i16 %B, i16* %Q
14 %z = sub i32 %x, %y ; <i32> [#uses=1]
15 ret i32 %z
16}
17