blob: bb85110563f40675897bd2cdbe1c5ad2852a6f65 [file] [log] [blame]
Reid Spencera3bc8502007-04-02 01:45:31 +00001; Tests to make sure bit counts of constants are folded
2; RUN: llvm-as < %s | opt -instcombine | llvm-dis -o /dev/null -f &&
3; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'llvm.ct'
4
5declare i32 @llvm.ctpop.i31(i31 %val)
6declare i32 @llvm.cttz.i32(i32 %val)
7declare i32 @llvm.ctlz.i33(i33 %val)
8
9define i32 %test(i32 %A) {
10 %c1 = i32 call @llvm.ctpop(i31 12415124)
11 %c2 = i32 call @llvm.cttz(i32 87359874)
12 %c3 = i32 call @llvm.ctlz(i33 87359874)
13 %r1 = add i32 %c1, %c2
14 %r2 = add i32 %r1, %c3
15 ret i32 %r2
16}