blob: 5b81c17d43a367e4aca7302221a0a40c40c2a3dd [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
Chandler Carruthddbc2742011-12-12 11:59:10 +00006declare i16 @llvm.cttz.i16(i16, i1)
Chandler Carrutha5839902007-08-06 20:57:16 +00007
8define i32 @test(i32* %P, i16* %Q) {
9 %A = load i16* %Q ; <i16> [#uses=1]
10 %x = load i32* %P ; <i32> [#uses=1]
Chandler Carruthddbc2742011-12-12 11:59:10 +000011 %B = call i16 @llvm.cttz.i16( i16 %A, i1 true ) ; <i16> [#uses=1]
Chandler Carrutha5839902007-08-06 20:57:16 +000012 %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