1 ; RUN: opt < %s -instcombine -S | grep ret | count 6
2 ; RUN: opt < %s -instcombine -S | not grep call.*bswap
4 define i1 @test1(i16 %tmp2) {
5 %tmp10 = call i16 @llvm.bswap.i16( i16 %tmp2 ) ; <i16> [#uses=1]
6 %tmp = icmp eq i16 %tmp10, 1 ; <i1> [#uses=1]
10 define i1 @test2(i32 %tmp) {
11 %tmp34 = tail call i32 @llvm.bswap.i32( i32 %tmp ) ; <i32> [#uses=1]
12 %tmp.upgrd.1 = icmp eq i32 %tmp34, 1 ; <i1> [#uses=1]
16 declare i32 @llvm.bswap.i32(i32)
18 define i1 @test3(i64 %tmp) {
19 %tmp34 = tail call i64 @llvm.bswap.i64( i64 %tmp ) ; <i64> [#uses=1]
20 %tmp.upgrd.2 = icmp eq i64 %tmp34, 1 ; <i1> [#uses=1]
24 declare i64 @llvm.bswap.i64(i64)
26 declare i16 @llvm.bswap.i16(i16)
30 define i32 @test4(i32 %a) nounwind {
32 %tmp2 = tail call i32 @llvm.bswap.i32( i32 %a )
33 %tmp4 = lshr i32 %tmp2, 24
38 define i32 @test5(i32 %a) nounwind {
40 %tmp2 = tail call i32 @llvm.bswap.i32( i32 %a )
41 %tmp4 = tail call i32 @llvm.bswap.i32( i32 %tmp2 )
46 define i32 @test6(i32 %a) nounwind {
48 %tmp2 = tail call i32 @llvm.bswap.i32( i32 %a )
49 %tmp4 = and i32 %tmp2, 255