1; RUN: opt < %s -S -instsimplify | FileCheck %s 2 3declare i32 @llvm.bitreverse.i32(i32) 4 5; CHECK-LABEL: @test1( 6; CHECK: ret i1 false 7define i1 @test1(i32 %arg) { 8 %a = or i32 %arg, 1 9 %b = call i32 @llvm.bitreverse.i32(i32 %a) 10 %res = icmp eq i32 %b, 0 11 ret i1 %res 12} 13 14; CHECK-LABEL: @test2( 15; CHECK: ret i1 false 16define i1 @test2(i32 %arg) { 17 %a = or i32 %arg, 1024 18 %b = call i32 @llvm.bitreverse.i32(i32 %a) 19 %res = icmp eq i32 %b, 0 20 ret i1 %res 21} 22 23; CHECK-LABEL: @test3( 24; CHECK: ret i1 false 25define i1 @test3(i32 %arg) { 26 %a = and i32 %arg, 1 27 %b = call i32 @llvm.bitreverse.i32(i32 %a) 28 %and = and i32 %b, 1 29 %res = icmp eq i32 %and, 1 30 ret i1 %res 31} 32