]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/blob - test/Transforms/InstCombine/and-compare.ll
[canonicalize] Teach InstCombine to canonicalize loads which are only
[opencl/llvm.git] / test / Transforms / InstCombine / and-compare.ll
1 ; RUN: opt < %s -instcombine -S | \
2 ; RUN: FileCheck %s
4 ; Should be optimized to one and.
5 define i1 @test1(i32 %a, i32 %b) {
6 ; CHECK-LABEL: @test1(
7 ; CHECK-NEXT: %1 = xor i32 %a, %b
8 ; CHECK-NEXT: %2 = and i32 %1, 65280
9 ; CHECK-NEXT: %tmp = icmp ne i32 %2, 0
10 ; CHECK-NEXT: ret i1 %tmp
11         %tmp1 = and i32 %a, 65280               ; <i32> [#uses=1]
12         %tmp3 = and i32 %b, 65280               ; <i32> [#uses=1]
13         %tmp = icmp ne i32 %tmp1, %tmp3         ; <i1> [#uses=1]
14         ret i1 %tmp
15 }