1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -S -passes=instsimplify | FileCheck %s
4 declare i32 @llvm.bitreverse.i32(i32)
5 declare <2 x i32> @llvm.bitreverse.v2i32(<2 x i32>)
7 define i1 @test1(i32 %arg) {
9 ; CHECK-NEXT: ret i1 false
12 %b = call i32 @llvm.bitreverse.i32(i32 %a)
13 %res = icmp eq i32 %b, 0
17 define i1 @test1v(<2 x i32> %arg) {
18 ; CHECK-LABEL: @test1v(
19 ; CHECK-NEXT: ret i1 false
21 %a = or <2 x i32> %arg, <i32 1, i32 0>
22 %b = call <2 x i32> @llvm.bitreverse.v2i32(<2 x i32> %a)
23 %c = extractelement <2 x i32> %b, i32 0
24 %res = icmp eq i32 %c, 0
28 define i1 @test2(i32 %arg) {
29 ; CHECK-LABEL: @test2(
30 ; CHECK-NEXT: ret i1 false
32 %a = or i32 %arg, 1024
33 %b = call i32 @llvm.bitreverse.i32(i32 %a)
34 %res = icmp eq i32 %b, 0
38 define i1 @test2v(<2 x i32> %arg) {
39 ; CHECK-LABEL: @test2v(
40 ; CHECK-NEXT: ret i1 false
42 %a = or <2 x i32> %arg, <i32 0, i32 1024>
43 %b = call <2 x i32> @llvm.bitreverse.v2i32(<2 x i32> %a)
44 %c = extractelement <2 x i32> %b, i32 1
45 %res = icmp eq i32 %c, 0
49 define i1 @test3(i32 %arg) {
50 ; CHECK-LABEL: @test3(
51 ; CHECK-NEXT: ret i1 false
54 %b = call i32 @llvm.bitreverse.i32(i32 %a)
56 %res = icmp eq i32 %and, 1
60 define i1 @test3v(<2 x i32> %arg) {
61 ; CHECK-LABEL: @test3v(
62 ; CHECK-NEXT: ret i1 false
64 %a = and <2 x i32> %arg, <i32 1, i32 -1>
65 %b = call <2 x i32> @llvm.bitreverse.v2i32(<2 x i32> %a)
66 %and = and <2 x i32> %b, <i32 1, i32 -1>
67 %ext = extractelement <2 x i32> %and, i32 0
68 %res = icmp eq i32 %ext, 1