Optimize bitwise even/odd test (-x&1 -> x&1) to not use negation.
[oota-llvm.git] / test / Transforms / InstCombine / pr23751.ll
1 ; RUN: opt -instcombine -S < %s | FileCheck %s
2
3 @d = common global i32 0, align 4
4
5 define i1 @f(i8 zeroext %p) #1 {
6 ; CHECK-NOT: ret i1 false
7   %1 = zext i8 %p to i32
8   %2 = load i32, i32* @d, align 4
9   %3 = or i32 %2, -2
10   %4 = add nsw i32 %3, %1
11   %5 = icmp ugt i32 %1, %4
12   ret i1 %5
13 }