Test Failure: Transforms/InstCombine/icmp.ll

Test source: git

Log:

Source: <stdin>
ERROR: Unsupported instruction:   %p1 = getelementptr inbounds i32, i32 addrspace(1)* getelementptr inbounds ([1000 x i32], [1000 x i32] addrspace(1)* @X_as1, i64 0, i64 0), i64 %i
ERROR: Unsupported instruction:   %bit = addrspacecast i8* %foo to i32 addrspace(3)*
ERROR: Unsupported instruction:   %bit = addrspacecast i8* %foo to i32 addrspace(1)*
ERROR: Unsupported instruction:   %xchg = cmpxchg i32* %sc, i32 %old_val, i32 %new_val seq_cst seq_cst
ERROR: Unsupported instruction:   %__constexpr_2 = ptrtoint i1 (i16)* @f10 to i8
ERROR: Unsupported instruction:   %__constexpr_1 = zext i8 ptrtoint (i1 (i16)* @f10 to i8) to i16
ERROR: Unsupported instruction:   %__constexpr_4 = ptrtoint i1 (i16)* @f10 to i8
ERROR: Unsupported instruction:   %__constexpr_3 = zext i8 ptrtoint (i1 (i16)* @f10 to i8) to i16
ERROR: Unsupported instruction:   %__constexpr_0 = mul i16 zext (i8 ptrtoint (i1 (i16)* @f10 to i8) to i16), zext (i8 ptrtoint (i1 (i16)* @f10 to i8) to i16)
ERROR: Unsupported instruction:   %cmp580 = icmp ule i16 mul (i16 zext (i8 ptrtoint (i1 (i16)* @f10 to i8) to i16), i16 zext (i8 ptrtoint (i1 (i16)* @f10 to i8) to i16)), %p
ERROR: Unsupported type: ppc_fp128
ERROR: Unsupported instruction:   %s2 = fpext float %x to ppc_fp128
ERROR: Unsupported type: ppc_fp128

----------------------------------------
define i32 @test1(i32 %X) {
%0:
  %a = icmp slt i32 %X, 0
  %b = zext i1 %a to i32
  ret i32 %b
}
=>
define i32 @test1(i32 %X) {
%0:
  %X.lobit = lshr i32 %X, 31
  ret i32 %X.lobit
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test1vec(<2 x i32> %X) {
%0:
  %a = icmp slt <2 x i32> %X, { 0, 0 }
  %b = zext <2 x i1> %a to <2 x i32>
  ret <2 x i32> %b
}
=>
define <2 x i32> @test1vec(<2 x i32> %X) {
%0:
  %X.lobit = lshr <2 x i32> %X, { 31, 31 }
  ret <2 x i32> %X.lobit
}
Transformation seems to be correct!


----------------------------------------
define i32 @test2(i32 %X) {
%0:
  %a = icmp ult i32 %X, 2147483648
  %b = zext i1 %a to i32
  ret i32 %b
}
=>
define i32 @test2(i32 %X) {
%0:
  %1 = xor i32 %X, 4294967295
  %X.lobit.not = lshr i32 %1, 31
  ret i32 %X.lobit.not
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test2vec(<2 x i32> %X) {
%0:
  %a = icmp ult <2 x i32> %X, { 2147483648, 2147483648 }
  %b = zext <2 x i1> %a to <2 x i32>
  ret <2 x i32> %b
}
=>
define <2 x i32> @test2vec(<2 x i32> %X) {
%0:
  %1 = xor <2 x i32> %X, { 4294967295, 4294967295 }
  %X.lobit.not = lshr <2 x i32> %1, { 31, 31 }
  ret <2 x i32> %X.lobit.not
}
Transformation seems to be correct!


----------------------------------------
define i32 @test3(i32 %X) {
%0:
  %a = icmp slt i32 %X, 0
  %b = sext i1 %a to i32
  ret i32 %b
}
=>
define i32 @test3(i32 %X) {
%0:
  %X.lobit = ashr i32 %X, 31
  ret i32 %X.lobit
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test4(i32 %X) {
%0:
  %a = icmp ult i32 %X, 2147483648
  %b = sext i1 %a to i32
  ret i32 %b
}
=>
define i32 @test4(i32 %X) {
%0:
  %X.lobit = ashr i32 %X, 31
  %X.lobit.not = xor i32 %X.lobit, 4294967295
  ret i32 %X.lobit.not
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i1> @test5_eq(<2 x i64> %x) {
%0:
  %V = icmp eq <2 x i64> %x, undef
  ret <2 x i1> %V
}
=>
define <2 x i1> @test5_eq(<2 x i64> %x) {
%0:
  ret <2 x i1> undef
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i1> @test5_ne(<2 x i64> %x) {
%0:
  %V = icmp ne <2 x i64> %x, undef
  ret <2 x i1> %V
}
=>
define <2 x i1> @test5_ne(<2 x i64> %x) {
%0:
  ret <2 x i1> undef
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i1> @test5_ugt(<2 x i64> %x) {
%0:
  %V = icmp ugt <2 x i64> %x, undef
  ret <2 x i1> %V
}
=>
define <2 x i1> @test5_ugt(<2 x i64> %x) {
%0:
  ret <2 x i1> { 0, 0 }
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i1> @test5_zero() {
%0:
  %V = icmp eq <2 x i64> { 0, 0 }, undef
  ret <2 x i1> %V
}
=>
define <2 x i1> @test5_zero() {
%0:
  ret <2 x i1> undef
}
Transformation seems to be correct!


----------------------------------------
define i32 @test6(i32 %a, i32 %b) {
%0:
  %c = icmp sle i32 %a, 4294967295
  %d = zext i1 %c to i32
  %e = sub i32 0, %d
  %f = and i32 %e, %b
  ret i32 %f
}
=>
define i32 @test6(i32 %a, i32 %b) {
%0:
  %a.lobit.neg = ashr i32 %a, 31
  %f = and i32 %a.lobit.neg, %b
  ret i32 %f
}
Transformation seems to be correct!


----------------------------------------
define i1 @test7(i32 %x) {
%0:
  %a = add i32 %x, 4294967295
  %b = icmp ult i32 %a, %x
  ret i1 %b
}
=>
define i1 @test7(i32 %x) {
%0:
  %b = icmp ne i32 %x, 0
  ret i1 %b
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test7_vec(<2 x i32> %x) {
%0:
  %a = add <2 x i32> %x, { 4294967295, 4294967295 }
  %b = icmp ult <2 x i32> %a, %x
  ret <2 x i1> %b
}
=>
define <2 x i1> @test7_vec(<2 x i32> %x) {
%0:
  %b = icmp ne <2 x i32> %x, { 0, 0 }
  ret <2 x i1> %b
}
Transformation seems to be correct!


----------------------------------------
define i1 @test8(i32 %x) {
%0:
  %a = add i32 %x, 4294967295
  %b = icmp eq i32 %a, %x
  ret i1 %b
}
=>
define i1 @test8(i32 %x) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test8_vec(<2 x i32> %x) {
%0:
  %a = add <2 x i32> %x, { 4294967295, 4294967295 }
  %b = icmp eq <2 x i32> %a, %x
  ret <2 x i1> %b
}
=>
define <2 x i1> @test8_vec(<2 x i32> %x) {
%0:
  ret <2 x i1> { 0, 0 }
}
Transformation seems to be correct!


----------------------------------------
define i1 @test9(i32 %x) {
%0:
  %a = add i32 %x, 4294967294
  %b = icmp ugt i32 %x, %a
  ret i1 %b
}
=>
define i1 @test9(i32 %x) {
%0:
  %b = icmp ugt i32 %x, 1
  ret i1 %b
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test9_vec(<2 x i32> %x) {
%0:
  %a = add <2 x i32> %x, { 4294967294, 4294967294 }
  %b = icmp ugt <2 x i32> %x, %a
  ret <2 x i1> %b
}
=>
define <2 x i1> @test9_vec(<2 x i32> %x) {
%0:
  %b = icmp ugt <2 x i32> %x, { 1, 1 }
  ret <2 x i1> %b
}
Transformation seems to be correct!


----------------------------------------
define i1 @test9b(i32 %x) {
%0:
  %a = add i32 %x, 4294967294
  %b = icmp ugt i32 %a, %x
  ret i1 %b
}
=>
define i1 @test9b(i32 %x) {
%0:
  %b = icmp ult i32 %x, 2
  ret i1 %b
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test9b_vec(<2 x i32> %x) {
%0:
  %a = add <2 x i32> %x, { 4294967294, 4294967294 }
  %b = icmp ugt <2 x i32> %a, %x
  ret <2 x i1> %b
}
=>
define <2 x i1> @test9b_vec(<2 x i32> %x) {
%0:
  %b = icmp ult <2 x i32> %x, { 2, 2 }
  ret <2 x i1> %b
}
Transformation seems to be correct!


----------------------------------------
define i1 @test10(i32 %x) {
%0:
  %a = add i32 %x, 4294967295
  %b = icmp slt i32 %a, %x
  ret i1 %b
}
=>
define i1 @test10(i32 %x) {
%0:
  %b = icmp ne i32 %x, 2147483648
  ret i1 %b
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test10_vec(<2 x i32> %x) {
%0:
  %a = add <2 x i32> %x, { 4294967295, 4294967295 }
  %b = icmp slt <2 x i32> %a, %x
  ret <2 x i1> %b
}
=>
define <2 x i1> @test10_vec(<2 x i32> %x) {
%0:
  %b = icmp ne <2 x i32> %x, { 2147483648, 2147483648 }
  ret <2 x i1> %b
}
Transformation seems to be correct!


----------------------------------------
define i1 @test10b(i32 %x) {
%0:
  %a = add i32 %x, 4294967295
  %b = icmp sgt i32 %a, %x
  ret i1 %b
}
=>
define i1 @test10b(i32 %x) {
%0:
  %b = icmp eq i32 %x, 2147483648
  ret i1 %b
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test10b_vec(<2 x i32> %x) {
%0:
  %a = add <2 x i32> %x, { 4294967295, 4294967295 }
  %b = icmp sgt <2 x i32> %a, %x
  ret <2 x i1> %b
}
=>
define <2 x i1> @test10b_vec(<2 x i32> %x) {
%0:
  %b = icmp eq <2 x i32> %x, { 2147483648, 2147483648 }
  ret <2 x i1> %b
}
Transformation seems to be correct!


----------------------------------------
define i1 @test11(i32 %x) {
%0:
  %a = add nsw i32 %x, 8
  %b = icmp slt i32 %x, %a
  ret i1 %b
}
=>
define i1 @test11(i32 %x) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test11_vec(<2 x i32> %x) {
%0:
  %a = add nsw <2 x i32> %x, { 8, 8 }
  %b = icmp slt <2 x i32> %x, %a
  ret <2 x i1> %b
}
=>
define <2 x i1> @test11_vec(<2 x i32> %x) {
%0:
  ret <2 x i1> { 1, 1 }
}
Transformation seems to be correct!


----------------------------------------
define i1 @test12(i1 %A) {
%0:
  %S = select i1 %A, i64 -4294967295, i64 8589934591
  %__constexpr_0 = bitcast <2 x i32> { 1, 4294967295 } to i64
  %B = icmp ne i64 %__constexpr_0, %S
  ret i1 %B
}
=>
define i1 @test12(i1 %A) {
%0:
  %not.A = xor i1 %A, 1
  ret i1 %not.A
}
Transformation seems to be correct!


----------------------------------------
define i1 @test13(i8 %X) {
%0:
  %cmp = icmp slt i8 undef, %X
  ret i1 %cmp
}
=>
define i1 @test13(i8 %X) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @test14(i8 %X) {
%0:
  %cmp = icmp slt i8 undef, 128
  ret i1 %cmp
}
=>
define i1 @test14(i8 %X) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @test15() {
%0:
  %cmp = icmp eq i8 undef, 128
  ret i1 %cmp
}
=>
define i1 @test15() {
%0:
  ret i1 undef
}
Transformation seems to be correct!


----------------------------------------
define i1 @test16() {
%0:
  %cmp = icmp ne i8 undef, 128
  ret i1 %cmp
}
=>
define i1 @test16() {
%0:
  ret i1 undef
}
Transformation seems to be correct!


----------------------------------------
define i1 @test17(i32 %x) {
%0:
  %shl = shl i32 1, %x
  %and = and i32 %shl, 8
  %cmp = icmp eq i32 %and, 0
  ret i1 %cmp
}
=>
define i1 @test17(i32 %x) {
%0:
  %cmp = icmp ne i32 %x, 3
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test17vec(<2 x i32> %x) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %x
  %and = and <2 x i32> %shl, { 8, 8 }
  %cmp = icmp eq <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test17vec(<2 x i32> %x) {
%0:
  %cmp = icmp ne <2 x i32> %x, { 3, 3 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test17a(i32 %x) {
%0:
  %shl = shl i32 1, %x
  %and = and i32 %shl, 7
  %cmp = icmp eq i32 %and, 0
  ret i1 %cmp
}
=>
define i1 @test17a(i32 %x) {
%0:
  %cmp = icmp ugt i32 %x, 2
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test17a_vec(<2 x i32> %x) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %x
  %and = and <2 x i32> %shl, { 7, 7 }
  %cmp = icmp eq <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test17a_vec(<2 x i32> %x) {
%0:
  %cmp = icmp ugt <2 x i32> %x, { 2, 2 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test18_eq(i32 %x) {
%0:
  %sh = lshr i32 8, %x
  %and = and i32 %sh, 1
  %cmp = icmp eq i32 %and, 0
  ret i1 %cmp
}
=>
define i1 @test18_eq(i32 %x) {
%0:
  %cmp = icmp ne i32 %x, 3
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test18_eq_vec(<2 x i32> %x) {
%0:
  %sh = lshr <2 x i32> { 8, 8 }, %x
  %and = and <2 x i32> %sh, { 1, 1 }
  %cmp = icmp eq <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test18_eq_vec(<2 x i32> %x) {
%0:
  %cmp = icmp ne <2 x i32> %x, { 3, 3 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test18_ne(i32 %x) {
%0:
  %sh = lshr i32 8, %x
  %and = and i32 %sh, 1
  %cmp = icmp ne i32 %and, 0
  ret i1 %cmp
}
=>
define i1 @test18_ne(i32 %x) {
%0:
  %cmp = icmp eq i32 %x, 3
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test18_ne_vec(<2 x i32> %x) {
%0:
  %sh = lshr <2 x i32> { 8, 8 }, %x
  %and = and <2 x i32> %sh, { 1, 1 }
  %cmp = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test18_ne_vec(<2 x i32> %x) {
%0:
  %cmp = icmp eq <2 x i32> %x, { 3, 3 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test19(i32 %x) {
%0:
  %shl = shl i32 1, %x
  %and = and i32 %shl, 8
  %cmp = icmp eq i32 %and, 8
  ret i1 %cmp
}
=>
define i1 @test19(i32 %x) {
%0:
  %cmp = icmp eq i32 %x, 3
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test19vec(<2 x i32> %x) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %x
  %and = and <2 x i32> %shl, { 8, 8 }
  %cmp = icmp eq <2 x i32> %and, { 8, 8 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test19vec(<2 x i32> %x) {
%0:
  %cmp = icmp eq <2 x i32> %x, { 3, 3 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @cmp_and_signbit_vec(<2 x i3> %x) {
%0:
  %and = and <2 x i3> %x, { 4, 4 }
  %cmp = icmp ne <2 x i3> %and, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @cmp_and_signbit_vec(<2 x i3> %x) {
%0:
  %cmp = icmp slt <2 x i3> %x, { 0, 0 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test20(i32 %x) {
%0:
  %shl = shl i32 1, %x
  %and = and i32 %shl, 8
  %cmp = icmp ne i32 %and, 0
  ret i1 %cmp
}
=>
define i1 @test20(i32 %x) {
%0:
  %cmp = icmp eq i32 %x, 3
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test20vec(<2 x i32> %x) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %x
  %and = and <2 x i32> %shl, { 8, 8 }
  %cmp = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test20vec(<2 x i32> %x) {
%0:
  %cmp = icmp eq <2 x i32> %x, { 3, 3 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test20a(i32 %x) {
%0:
  %shl = shl i32 1, %x
  %and = and i32 %shl, 7
  %cmp = icmp ne i32 %and, 0
  ret i1 %cmp
}
=>
define i1 @test20a(i32 %x) {
%0:
  %cmp = icmp ult i32 %x, 3
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test20a_vec(<2 x i32> %x) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %x
  %and = and <2 x i32> %shl, { 7, 7 }
  %cmp = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test20a_vec(<2 x i32> %x) {
%0:
  %cmp = icmp ult <2 x i32> %x, { 3, 3 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test21(i8 %x, i8 %y) {
%0:
  %A = or i8 %x, 1
  %B = icmp ugt i8 %A, 3
  ret i1 %B
}
=>
define i1 @test21(i8 %x, i8 %y) {
%0:
  %B = icmp ugt i8 %x, 3
  ret i1 %B
}
Transformation seems to be correct!


----------------------------------------
define i1 @test22(i8 %x, i8 %y) {
%0:
  %A = or i8 %x, 1
  %B = icmp ult i8 %A, 4
  ret i1 %B
}
=>
define i1 @test22(i8 %x, i8 %y) {
%0:
  %B = icmp ult i8 %x, 4
  ret i1 %B
}
Transformation seems to be correct!


----------------------------------------
define i1 @test23(i32 %x) {
%0:
  %i3 = sdiv i32 %x, 2966332661
  %i4 = icmp eq i32 %i3, 4294967295
  ret i1 %i4
}
=>
define i1 @test23(i32 %x) {
%0:
  %i4 = icmp sgt i32 %x, 1328634634
  ret i1 %i4
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test23vec(<2 x i32> %x) {
%0:
  %i3 = sdiv <2 x i32> %x, { 2966332661, 2966332661 }
  %i4 = icmp eq <2 x i32> %i3, { 4294967295, 4294967295 }
  ret <2 x i1> %i4
}
=>
define <2 x i1> @test23vec(<2 x i32> %x) {
%0:
  %i4 = icmp sgt <2 x i32> %x, { 1328634634, 1328634634 }
  ret <2 x i1> %i4
}
Transformation seems to be correct!


----------------------------------------
@X = global 4000 bytes, align 16

define i1 @test24(i64 %i) {
%0:
  %__constexpr_0 = gep inbounds * @X, 4000 x i64 0, 4 x i64 0
  %p1 = gep inbounds * %__constexpr_0, 4 x i64 %i
  %__constexpr_1 = gep inbounds * @X, 4000 x i64 1, 4 x i64 0
  %cmp = icmp eq * %p1, %__constexpr_1
  ret i1 %cmp
}
=>
@X = global 4000 bytes, align 16

define i1 @test24(i64 %i) {
%0:
  %cmp = icmp eq i64 %i, 1000
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test24_neg_offs(* %p, i64 %offs) {
%0:
  %p1 = gep inbounds * %p, 4 x i64 %offs
  %conv1 = ptrtoint * %p to i64
  %conv2 = ptrtoint * %p1 to i64
  %delta = sub i64 %conv1, %conv2
  %cmp = icmp eq i64 %delta, 8
  ret i1 %cmp
}
=>
define i1 @test24_neg_offs(* %p, i64 %offs) {
%0:
  %p1.idx.neg = mul i64 %offs, -4
  %cmp = icmp eq i64 %p1.idx.neg, 8
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test27(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nsw i32 %x, %z
  %rhs = sub nsw i32 %y, %z
  %c = icmp sgt i32 %lhs, %rhs
  ret i1 %c
}
=>
define i1 @test27(i32 %x, i32 %y, i32 %z) {
%0:
  %c = icmp sgt i32 %x, %y
  ret i1 %c
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test27_extra_uses(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nsw i32 %x, %z
  call void @foo(i32 %lhs)
  %rhs = sub nsw i32 %y, %z
  call void @foo(i32 %rhs)
  %c = icmp sgt i32 %lhs, %rhs
  ret i1 %c
}
=>
define i1 @test27_extra_uses(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nsw i32 %x, %z
  call void @foo(i32 %lhs)
  %rhs = sub nsw i32 %y, %z
  call void @foo(i32 %rhs)
  %c = icmp sgt i32 %x, %y
  ret i1 %c
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test28(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nuw i32 %x, %z
  %rhs = sub nuw i32 %y, %z
  %c = icmp ugt i32 %lhs, %rhs
  ret i1 %c
}
=>
define i1 @test28(i32 %x, i32 %y, i32 %z) {
%0:
  %c = icmp ugt i32 %x, %y
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @test28_extra_uses(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nuw i32 %x, %z
  call void @foo(i32 %lhs)
  %rhs = sub nuw i32 %y, %z
  call void @foo(i32 %rhs)
  %c = icmp ugt i32 %lhs, %rhs
  ret i1 %c
}
=>
define i1 @test28_extra_uses(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nuw i32 %x, %z
  call void @foo(i32 %lhs)
  %rhs = sub nuw i32 %y, %z
  call void @foo(i32 %rhs)
  %c = icmp ugt i32 %x, %y
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @ugt_sub(i32 %xsrc, i32 %y) {
%0:
  %x = udiv i32 %xsrc, 42
  %sub = sub i32 %x, %y
  %cmp = icmp ugt i32 %sub, %x
  ret i1 %cmp
}
=>
define i1 @ugt_sub(i32 %xsrc, i32 %y) {
%0:
  %x = udiv i32 %xsrc, 42
  %cmp = icmp ult i32 %x, %y
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @ult_sub(<2 x i8> %xsrc, <2 x i8> %y) {
%0:
  %x = udiv <2 x i8> %xsrc, { 42, 214 }
  %sub = sub <2 x i8> %x, %y
  %cmp = icmp ult <2 x i8> %x, %sub
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @ult_sub(<2 x i8> %xsrc, <2 x i8> %y) {
%0:
  %x = udiv <2 x i8> %xsrc, { 42, 214 }
  %cmp = icmp ult <2 x i8> %x, %y
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test33(i32 %x, i32 %y) {
%0:
  %lhs = sub nsw i32 %x, %y
  %c = icmp sgt i32 %lhs, %x
  ret i1 %c
}
=>
define i1 @test33(i32 %x, i32 %y) {
%0:
  %c = icmp slt i32 %y, 0
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @test34(i32 %x, i32 %y) {
%0:
  %lhs = sub nuw i32 %x, %y
  %c = icmp ugt i32 %lhs, %x
  ret i1 %c
}
=>
define i1 @test34(i32 %x, i32 %y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @test35(i32 %x, i32 %y) {
%0:
  %rhs = sub nsw i32 %x, %y
  %c = icmp sgt i32 %x, %rhs
  ret i1 %c
}
=>
define i1 @test35(i32 %x, i32 %y) {
%0:
  %c = icmp sgt i32 %y, 0
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @test36(i32 %x, i32 %y) {
%0:
  %rhs = sub nuw i32 %x, %y
  %c = icmp ugt i32 %x, %rhs
  ret i1 %c
}
=>
define i1 @test36(i32 %x, i32 %y) {
%0:
  %c = icmp ne i32 %y, 0
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @test37(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nsw i32 %x, %y
  %rhs = sub nsw i32 %x, %z
  %c = icmp sgt i32 %lhs, %rhs
  ret i1 %c
}
=>
define i1 @test37(i32 %x, i32 %y, i32 %z) {
%0:
  %c = icmp sgt i32 %z, %y
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @test37_extra_uses(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nsw i32 %x, %y
  call void @foo(i32 %lhs)
  %rhs = sub nsw i32 %x, %z
  call void @foo(i32 %rhs)
  %c = icmp sgt i32 %lhs, %rhs
  ret i1 %c
}
=>
define i1 @test37_extra_uses(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nsw i32 %x, %y
  call void @foo(i32 %lhs)
  %rhs = sub nsw i32 %x, %z
  call void @foo(i32 %rhs)
  %c = icmp sgt i32 %z, %y
  ret i1 %c
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @neg_max_s32(i32 %x, i32 %y) {
%0:
  %nx = sub nsw i32 0, %x
  %ny = sub nsw i32 0, %y
  %c = icmp slt i32 %nx, %ny
  %s = select i1 %c, i32 %ny, i32 %nx
  %r = sub nsw i32 0, %s
  ret i32 %r
}
=>
define i32 @neg_max_s32(i32 %x, i32 %y) {
%0:
  %c = icmp slt i32 %y, %x
  %s.v = select i1 %c, i32 %y, i32 %x
  ret i32 %s.v
}
Transformation seems to be correct!


----------------------------------------
define <4 x i32> @neg_max_v4s32(<4 x i32> %x, <4 x i32> %y) {
%0:
  %nx = sub nsw <4 x i32> { 0, 0, 0, 0 }, %x
  %ny = sub nsw <4 x i32> { 0, 0, 0, 0 }, %y
  %c = icmp sgt <4 x i32> %nx, %ny
  %s = select <4 x i1> %c, <4 x i32> %nx, <4 x i32> %ny
  %r = sub <4 x i32> { 0, 0, 0, 0 }, %s
  ret <4 x i32> %r
}
=>
define <4 x i32> @neg_max_v4s32(<4 x i32> %x, <4 x i32> %y) {
%0:
  %c = icmp sgt <4 x i32> %y, %x
  %s.v = select <4 x i1> %c, <4 x i32> %x, <4 x i32> %y
  ret <4 x i32> %s.v
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test38(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nuw i32 %x, %y
  %rhs = sub nuw i32 %x, %z
  %c = icmp ugt i32 %lhs, %rhs
  ret i1 %c
}
=>
define i1 @test38(i32 %x, i32 %y, i32 %z) {
%0:
  %c = icmp ugt i32 %z, %y
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @test38_extra_uses(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nuw i32 %x, %y
  call void @foo(i32 %lhs)
  %rhs = sub nuw i32 %x, %z
  call void @foo(i32 %rhs)
  %c = icmp ugt i32 %lhs, %rhs
  ret i1 %c
}
=>
define i1 @test38_extra_uses(i32 %x, i32 %y, i32 %z) {
%0:
  %lhs = sub nuw i32 %x, %y
  call void @foo(i32 %lhs)
  %rhs = sub nuw i32 %x, %z
  call void @foo(i32 %rhs)
  %c = icmp ugt i32 %z, %y
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @test39(i32 %X, i32 %Y) {
%0:
  %A = ashr exact i32 %X, %Y
  %B = icmp eq i32 %A, 0
  ret i1 %B
}
=>
define i1 @test39(i32 %X, i32 %Y) {
%0:
  %B = icmp eq i32 %X, 0
  ret i1 %B
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test39vec(<2 x i32> %X, <2 x i32> %Y) {
%0:
  %A = ashr exact <2 x i32> %X, %Y
  %B = icmp eq <2 x i32> %A, { 0, 0 }
  ret <2 x i1> %B
}
=>
define <2 x i1> @test39vec(<2 x i32> %X, <2 x i32> %Y) {
%0:
  %B = icmp eq <2 x i32> %X, { 0, 0 }
  ret <2 x i1> %B
}
Transformation seems to be correct!


----------------------------------------
define i1 @test40(i32 %X, i32 %Y) {
%0:
  %A = lshr exact i32 %X, %Y
  %B = icmp ne i32 %A, 0
  ret i1 %B
}
=>
define i1 @test40(i32 %X, i32 %Y) {
%0:
  %B = icmp ne i32 %X, 0
  ret i1 %B
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test40vec(<2 x i32> %X, <2 x i32> %Y) {
%0:
  %A = lshr exact <2 x i32> %X, %Y
  %B = icmp ne <2 x i32> %A, { 0, 0 }
  ret <2 x i1> %B
}
=>
define <2 x i1> @test40vec(<2 x i32> %X, <2 x i32> %Y) {
%0:
  %B = icmp ne <2 x i32> %X, { 0, 0 }
  ret <2 x i1> %B
}
Transformation seems to be correct!


----------------------------------------
define i1 @shr_exact(i132 %x) {
%0:
  %sh = ashr exact i132 %x, 4
  %cmp = icmp eq i132 %sh, 2
  ret i1 %cmp
}
=>
define i1 @shr_exact(i132 %x) {
%0:
  %cmp = icmp eq i132 %x, 32
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @shr_exact_vec(<2 x i132> %x) {
%0:
  %sh = lshr exact <2 x i132> %x, { 4, 4 }
  %cmp = icmp ne <2 x i132> %sh, { 2, 2 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @shr_exact_vec(<2 x i132> %x) {
%0:
  %cmp = icmp ne <2 x i132> %x, { 32, 32 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test41(i32 %X, i32 %Y) {
%0:
  %A = urem i32 %X, %Y
  %B = icmp ugt i32 %Y, %A
  ret i1 %B
}
=>
define i1 @test41(i32 %X, i32 %Y) {
%0:
  ret i1 1
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test42(i32 %X, i32 %Y) {
%0:
  %A = srem i32 %X, %Y
  %B = icmp slt i32 %A, %Y
  ret i1 %B
}
=>
define i1 @test42(i32 %X, i32 %Y) {
%0:
  %B = icmp sgt i32 %Y, 4294967295
  ret i1 %B
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test43(i32 %X, i32 %Y) {
%0:
  %A = srem i32 %X, %Y
  %B = icmp slt i32 %Y, %A
  ret i1 %B
}
=>
define i1 @test43(i32 %X, i32 %Y) {
%0:
  %B = icmp slt i32 %Y, 0
  ret i1 %B
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test44(i32 %X, i32 %Y) {
%0:
  %A = srem i32 %X, %Y
  %B = icmp slt i32 %A, %Y
  ret i1 %B
}
=>
define i1 @test44(i32 %X, i32 %Y) {
%0:
  %B = icmp sgt i32 %Y, 4294967295
  ret i1 %B
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test45(i32 %X, i32 %Y) {
%0:
  %A = srem i32 %X, %Y
  %B = icmp slt i32 %Y, %A
  ret i1 %B
}
=>
define i1 @test45(i32 %X, i32 %Y) {
%0:
  %B = icmp slt i32 %Y, 0
  ret i1 %B
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test46(i32 %X, i32 %Y, i32 %Z) {
%0:
  %A = ashr exact i32 %X, %Z
  %B = ashr exact i32 %Y, %Z
  %C = icmp ult i32 %A, %B
  ret i1 %C
}
=>
define i1 @test46(i32 %X, i32 %Y, i32 %Z) {
%0:
  %C = icmp ult i32 %X, %Y
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @test47(i32 %X, i32 %Y, i32 %Z) {
%0:
  %A = ashr exact i32 %X, %Z
  %B = ashr exact i32 %Y, %Z
  %C = icmp ugt i32 %A, %B
  ret i1 %C
}
=>
define i1 @test47(i32 %X, i32 %Y, i32 %Z) {
%0:
  %C = icmp ugt i32 %X, %Y
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @test48(i32 %X, i32 %Y, i32 %Z) {
%0:
  %A = sdiv exact i32 %X, %Z
  %B = sdiv exact i32 %Y, %Z
  %C = icmp eq i32 %A, %B
  ret i1 %C
}
=>
define i1 @test48(i32 %X, i32 %Y, i32 %Z) {
%0:
  %C = icmp eq i32 %X, %Y
  ret i1 %C
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @PR32949(i32 %X, i32 %Y, i32 %Z) {
%0:
  %A = sdiv exact i32 %X, %Z
  %B = sdiv exact i32 %Y, %Z
  %C = icmp sgt i32 %A, %B
  ret i1 %C
}
=>
define i1 @PR32949(i32 %X, i32 %Y, i32 %Z) {
%0:
  %A = sdiv exact i32 %X, %Z
  %B = sdiv exact i32 %Y, %Z
  %C = icmp sgt i32 %A, %B
  ret i1 %C
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i1> @test49(<2 x i32> %i3) {
%entry:
  %i11 = and <2 x i32> %i3, { 3, 3 }
  %cmp = icmp ult <2 x i32> %i11, { 4, 4 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test49(<2 x i32> %i3) {
%entry:
  ret <2 x i1> { 1, 1 }
}
Transformation seems to be correct!


----------------------------------------
define i1 @test50(i16 %X, i32 %Y) {
%0:
  %A = zext i16 %X to i32
  %B = srem i32 %A, %Y
  %C = icmp sgt i32 %B, 4294967295
  ret i1 %C
}
=>
define i1 @test50(i16 %X, i32 %Y) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @test51(i32 %X, i32 %Y) {
%0:
  %A = and i32 %X, 2147483648
  %B = srem i32 %A, %Y
  %C = icmp sgt i32 %B, 4294967295
  ret i1 %C
}
=>
define i1 @test51(i32 %X, i32 %Y) {
%0:
  %A = and i32 %X, 2147483648
  %B = srem i32 %A, %Y
  %C = icmp sgt i32 %B, 4294967295
  ret i1 %C
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test52(i32 %x1) {
%0:
  %conv = and i32 %x1, 255
  %cmp = icmp eq i32 %conv, 127
  %i2 = lshr i32 %x1, 16
  %i3 = trunc i32 %i2 to i8
  %cmp15 = icmp eq i8 %i3, 76
  %A = and i1 %cmp, %cmp15
  ret i1 %A
}
=>
define i1 @test52(i32 %x1) {
%0:
  %1 = and i32 %x1, 16711935
  %2 = icmp eq i32 %1, 4980863
  ret i1 %2
}
Transformation seems to be correct!


----------------------------------------
define i1 @test52b(i128 %x1) {
%0:
  %conv = and i128 %x1, 255
  %cmp = icmp eq i128 %conv, 127
  %i2 = lshr i128 %x1, 16
  %i3 = trunc i128 %i2 to i8
  %cmp15 = icmp eq i8 %i3, 76
  %A = and i1 %cmp, %cmp15
  ret i1 %A
}
=>
define i1 @test52b(i128 %x1) {
%0:
  %1 = and i128 %x1, 16711935
  %2 = icmp eq i128 %1, 4980863
  ret i1 %2
}
Transformation seems to be correct!


----------------------------------------
define i1 @test53(i32 %a, i32 %b) {
%0:
  %x = sdiv exact i32 %a, 30
  %y = sdiv i32 %b, 30
  %z = icmp eq i32 %x, %y
  ret i1 %z
}
=>
define i1 @test53(i32 %a, i32 %b) {
%0:
  %x = sdiv exact i32 %a, 30
  %y = sdiv i32 %b, 30
  %z = icmp eq i32 %x, %y
  ret i1 %z
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test54(i8 %a) {
%0:
  %ext = zext i8 %a to i32
  %and = and i32 %ext, 192
  %ret = icmp eq i32 %and, 128
  ret i1 %ret
}
=>
define i1 @test54(i8 %a) {
%0:
  %1 = and i8 %a, 192
  %ret = icmp eq i8 %1, 128
  ret i1 %ret
}
Transformation seems to be correct!


----------------------------------------
define i1 @test55(i32 %a) {
%0:
  %sub = sub i32 0, %a
  %cmp = icmp eq i32 %sub, 123
  ret i1 %cmp
}
=>
define i1 @test55(i32 %a) {
%0:
  %cmp = icmp eq i32 %a, 4294967173
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test55vec(<2 x i32> %a) {
%0:
  %sub = sub <2 x i32> { 0, 0 }, %a
  %cmp = icmp eq <2 x i32> %sub, { 123, 123 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test55vec(<2 x i32> %a) {
%0:
  %cmp = icmp eq <2 x i32> %a, { 4294967173, 4294967173 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test56(i32 %a) {
%0:
  %sub = sub i32 10, %a
  %cmp = icmp eq i32 %sub, 123
  ret i1 %cmp
}
=>
define i1 @test56(i32 %a) {
%0:
  %cmp = icmp eq i32 %a, 4294967183
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test56vec(<2 x i32> %a) {
%0:
  %sub = sub <2 x i32> { 10, 10 }, %a
  %cmp = icmp eq <2 x i32> %sub, { 123, 123 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test56vec(<2 x i32> %a) {
%0:
  %cmp = icmp eq <2 x i32> %a, { 4294967183, 4294967183 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test57(i32 %a) {
%0:
  %and = and i32 %a, 4294967294
  %cmp = icmp ne i32 %and, 0
  call void @foo(i32 %and)
  ret i1 %cmp
}
=>
define i1 @test57(i32 %a) {
%0:
  %and = and i32 %a, 4294967294
  %cmp = icmp ne i32 %and, 0
  call void @foo(i32 %and)
  ret i1 %cmp
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @cmpabs1(i64 %val) {
%0:
  %sub = sub nsw i64 0, %val
  %cmp = icmp slt i64 %val, 0
  %sub.val = select i1 %cmp, i64 %sub, i64 %val
  %tobool = icmp ne i64 %sub.val, 0
  ret i1 %tobool
}
=>
define i1 @cmpabs1(i64 %val) {
%0:
  %tobool = icmp ne i64 %val, 0
  ret i1 %tobool
}
Transformation seems to be correct!


----------------------------------------
define i1 @cmpabs2(i64 %val) {
%0:
  %sub = sub nsw i64 0, %val
  %cmp = icmp slt i64 %val, 0
  %sub.val = select i1 %cmp, i64 %val, i64 %sub
  %tobool = icmp ne i64 %sub.val, 0
  ret i1 %tobool
}
=>
define i1 @cmpabs2(i64 %val) {
%0:
  %tobool = icmp ne i64 %val, 0
  ret i1 %tobool
}
Transformation seems to be correct!


----------------------------------------
define i1 @abs_intrin_eq_zero(i8 %x) {
%0:
  %abs = abs i8 %x, 0
  %cmp = icmp eq i8 %abs, 0
  ret i1 %cmp
}
=>
define i1 @abs_intrin_eq_zero(i8 %x) {
%0:
  %cmp = icmp eq i8 %x, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @abs_intrin_ne_zero(i8 %x) {
%0:
  %abs = abs i8 %x, 0
  %cmp = icmp ne i8 %abs, 0
  ret i1 %cmp
}
=>
define i1 @abs_intrin_ne_zero(i8 %x) {
%0:
  %cmp = icmp ne i8 %x, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define void @test58() {
%0:
  %cast = bitcast <1 x i64> { 36029346783166592 } to i64
  %call = call i32 @test58_d(i64 %cast)
  ret void
}
=>
define void @test58() {
%0:
  %call = call i32 @test58_d(i64 36029346783166592)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define i1 @test59(* %foo) {
%0:
  %bit = bitcast * %foo to *
  %gep1 = gep inbounds * %bit, 4 x i64 2
  %gep2 = gep inbounds * %foo, 1 x i64 10
  %cast1 = bitcast * %gep1 to *
  %cmp = icmp ult * %cast1, %gep2
  %use = ptrtoint * %cast1 to i64
  %call = call i32 @test58_d(i64 %use)
  ret i1 %cmp
}
=>
define i1 @test59(* %foo) {
%0:
  %gep1 = gep inbounds * %foo, 1 x i64 8
  %use = ptrtoint * %gep1 to i64
  %call = call i32 @test58_d(i64 %use)
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @test60(* %foo, i64 %i, i64 %j) {
%0:
  %bit = bitcast * %foo to *
  %gep1 = gep inbounds * %bit, 4 x i64 %i
  %gep2 = gep inbounds * %foo, 1 x i64 %j
  %cast1 = bitcast * %gep1 to *
  %cmp = icmp ult * %cast1, %gep2
  ret i1 %cmp
}
=>
define i1 @test60(* %foo, i64 %i, i64 %j) {
%0:
  %gep1.idx = shl nsw i64 %i, 2
  %1 = icmp slt i64 %gep1.idx, %j
  ret i1 %1
}
Transformation seems to be correct!


----------------------------------------
define i1 @test61(* %foo, i64 %i, i64 %j) {
%0:
  %bit = bitcast * %foo to *
  %gep1 = gep * %bit, 4 x i64 %i
  %gep2 = gep * %foo, 1 x i64 %j
  %cast1 = bitcast * %gep1 to *
  %cmp = icmp ult * %cast1, %gep2
  ret i1 %cmp
}
=>
define i1 @test61(* %foo, i64 %i, i64 %j) {
%0:
  %bit = bitcast * %foo to *
  %gep1 = gep * %bit, 4 x i64 %i
  %gep2 = gep * %foo, 1 x i64 %j
  %cast1 = bitcast * %gep1 to *
  %cmp = icmp ugt * %gep2, %cast1
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test62(* %a) {
%0:
  %arrayidx1 = gep inbounds * %a, 1 x i64 1
  %arrayidx2 = gep inbounds * %a, 1 x i64 10
  %cmp = icmp slt * %arrayidx1, %arrayidx2
  ret i1 %cmp
}
=>
define i1 @test62(* %a) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @test63(i8 %a, i32 %b) {
%0:
  %z = zext i8 %a to i32
  %t = and i32 %b, 255
  %c = icmp eq i32 %z, %t
  ret i1 %c
}
=>
define i1 @test63(i8 %a, i32 %b) {
%0:
  %1 = trunc i32 %b to i8
  %c = icmp eq i8 %1, %a
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @test64(i8 %a, i32 %b) {
%0:
  %t = and i32 %b, 255
  %z = zext i8 %a to i32
  %c = icmp eq i32 %t, %z
  ret i1 %c
}
=>
define i1 @test64(i8 %a, i32 %b) {
%0:
  %1 = trunc i32 %b to i8
  %c = icmp eq i8 %1, %a
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @test65(i64 %A, i64 %B) {
%0:
  %s1 = add i64 %A, %B
  %s2 = add i64 %A, %B
  %cmp = icmp eq i64 %s1, %s2
  ret i1 %cmp
}
=>
define i1 @test65(i64 %A, i64 %B) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @test66(i64 %A, i64 %B) {
%0:
  %s1 = add i64 %A, %B
  %s2 = add i64 %B, %A
  %cmp = icmp eq i64 %s1, %s2
  ret i1 %cmp
}
=>
define i1 @test66(i64 %A, i64 %B) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @test67(i32 %x) {
%0:
  %and = and i32 %x, 127
  %cmp = icmp sgt i32 %and, 31
  ret i1 %cmp
}
=>
define i1 @test67(i32 %x) {
%0:
  %and = and i32 %x, 96
  %cmp = icmp ne i32 %and, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test67inverse(i32 %x) {
%0:
  %and = and i32 %x, 127
  %cmp = icmp sle i32 %and, 31
  ret i1 %cmp
}
=>
define i1 @test67inverse(i32 %x) {
%0:
  %and = and i32 %x, 96
  %cmp = icmp eq i32 %and, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test67vec(<2 x i32> %x) {
%0:
  %and = and <2 x i32> %x, { 96, 96 }
  %cmp = icmp ugt <2 x i32> %and, { 31, 31 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test67vec(<2 x i32> %x) {
%0:
  %and = and <2 x i32> %x, { 96, 96 }
  %cmp = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test67vec2(<2 x i32> %x) {
%0:
  %and = and <2 x i32> %x, { 127, 127 }
  %cmp = icmp ugt <2 x i32> %and, { 31, 31 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test67vec2(<2 x i32> %x) {
%0:
  %and = and <2 x i32> %x, { 96, 96 }
  %cmp = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test67vecinverse(<2 x i32> %x) {
%0:
  %and = and <2 x i32> %x, { 96, 96 }
  %cmp = icmp sle <2 x i32> %and, { 31, 31 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @test67vecinverse(<2 x i32> %x) {
%0:
  %and = and <2 x i32> %x, { 96, 96 }
  %cmp = icmp eq <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test68(i32 %x) {
%0:
  %and = and i32 %x, 127
  %cmp = icmp sgt i32 %and, 30
  ret i1 %cmp
}
=>
define i1 @test68(i32 %x) {
%0:
  %and = and i32 %x, 127
  %cmp = icmp ugt i32 %and, 30
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @test70(i32 %X) {
%0:
  %A = srem i32 5, %X
  %B = add i32 %A, 2
  %C = icmp ne i32 %B, 4
  ret i1 %C
}
=>
define i1 @test70(i32 %X) {
%0:
  %A = srem i32 5, %X
  %C = icmp ne i32 %A, 2
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test70vec(<2 x i32> %X) {
%0:
  %B = add <2 x i32> %X, { 2, 2 }
  %C = icmp ne <2 x i32> %B, { 4, 4 }
  ret <2 x i1> %C
}
=>
define <2 x i1> @test70vec(<2 x i32> %X) {
%0:
  %C = icmp ne <2 x i32> %X, { 2, 2 }
  ret <2 x i1> %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sext16trunc(i32 %x) {
%0:
  %trunc = trunc i32 %x to i16
  %sext = sext i16 %trunc to i32
  %cmp = icmp slt i32 %sext, 36
  ret i1 %cmp
}
=>
define i1 @icmp_sext16trunc(i32 %x) {
%0:
  %1 = trunc i32 %x to i16
  %cmp = icmp slt i16 %1, 36
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sext8trunc(i32 %x) {
%0:
  %trunc = trunc i32 %x to i8
  %sext = sext i8 %trunc to i32
  %cmp = icmp slt i32 %sext, 36
  ret i1 %cmp
}
=>
define i1 @icmp_sext8trunc(i32 %x) {
%0:
  %1 = trunc i32 %x to i8
  %cmp = icmp slt i8 %1, 36
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_sext8trunc_vec(<2 x i32> %x) {
%0:
  %trunc = trunc <2 x i32> %x to <2 x i8>
  %sext = sext <2 x i8> %trunc to <2 x i32>
  %cmp = icmp slt <2 x i32> %sext, { 36, 36 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_sext8trunc_vec(<2 x i32> %x) {
%0:
  %1 = trunc <2 x i32> %x to <2 x i8>
  %cmp = icmp slt <2 x i8> %1, { 36, 36 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl16(i32 %x) {
%0:
  %shl = shl i32 %x, 16
  %cmp = icmp slt i32 %shl, 2359296
  ret i1 %cmp
}
=>
define i1 @icmp_shl16(i32 %x) {
%0:
  %1 = trunc i32 %x to i16
  %cmp = icmp slt i16 %1, 36
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl17(i32 %x) {
%0:
  %shl = shl i32 %x, 17
  %cmp = icmp slt i32 %shl, 2359296
  ret i1 %cmp
}
=>
define i1 @icmp_shl17(i32 %x) {
%0:
  %shl = shl i32 %x, 17
  %cmp = icmp slt i32 %shl, 2359296
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl16_vec(<2 x i32> %x) {
%0:
  %shl = shl <2 x i32> %x, { 16, 16 }
  %cmp = icmp slt <2 x i32> %shl, { 2359296, 2359296 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl16_vec(<2 x i32> %x) {
%0:
  %1 = trunc <2 x i32> %x to <2 x i16>
  %cmp = icmp slt <2 x i16> %1, { 36, 36 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl24(i32 %x) {
%0:
  %shl = shl i32 %x, 24
  %cmp = icmp slt i32 %shl, 603979776
  ret i1 %cmp
}
=>
define i1 @icmp_shl24(i32 %x) {
%0:
  %1 = trunc i32 %x to i8
  %cmp = icmp slt i8 %1, 36
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl_eq(i32 %x) {
%0:
  %mul = shl i32 %x, 5
  %cmp = icmp eq i32 %mul, 0
  ret i1 %cmp
}
=>
define i1 @icmp_shl_eq(i32 %x) {
%0:
  %mul.mask = and i32 %x, 134217727
  %cmp = icmp eq i32 %mul.mask, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_eq_vec(<2 x i32> %x) {
%0:
  %mul = shl <2 x i32> %x, { 5, 5 }
  %cmp = icmp eq <2 x i32> %mul, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_eq_vec(<2 x i32> %x) {
%0:
  %mul.mask = and <2 x i32> %x, { 134217727, 134217727 }
  %cmp = icmp eq <2 x i32> %mul.mask, { 0, 0 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl_nsw_ne(i32 %x) {
%0:
  %mul = shl nsw i32 %x, 7
  %cmp = icmp ne i32 %mul, 0
  ret i1 %cmp
}
=>
define i1 @icmp_shl_nsw_ne(i32 %x) {
%0:
  %cmp = icmp ne i32 %x, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_nsw_ne_vec(<2 x i32> %x) {
%0:
  %mul = shl nsw <2 x i32> %x, { 7, 7 }
  %cmp = icmp ne <2 x i32> %mul, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_nsw_ne_vec(<2 x i32> %x) {
%0:
  %cmp = icmp ne <2 x i32> %x, { 0, 0 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl_ne(i32 %x) {
%0:
  %mul = shl i32 %x, 7
  %cmp = icmp ne i32 %mul, 0
  ret i1 %cmp
}
=>
define i1 @icmp_shl_ne(i32 %x) {
%0:
  %mul.mask = and i32 %x, 33554431
  %cmp = icmp ne i32 %mul.mask, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_ne_vec(<2 x i32> %x) {
%0:
  %mul = shl <2 x i32> %x, { 7, 7 }
  %cmp = icmp ne <2 x i32> %mul, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_ne_vec(<2 x i32> %x) {
%0:
  %mul.mask = and <2 x i32> %x, { 33554431, 33554431 }
  %cmp = icmp ne <2 x i32> %mul.mask, { 0, 0 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_nuw_ne_vec(<2 x i32> %x) {
%0:
  %shl = shl nuw <2 x i32> %x, { 7, 7 }
  %cmp = icmp ne <2 x i32> %shl, { 256, 256 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_nuw_ne_vec(<2 x i32> %x) {
%0:
  %cmp = icmp ne <2 x i32> %x, { 2, 2 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_mul_nsw(i32 %x) {
%0:
  %mul = mul nsw i32 %x, 12
  %cmp = icmp sgt i32 %mul, 0
  ret i1 %cmp
}
=>
define i1 @icmp_mul_nsw(i32 %x) {
%0:
  %cmp = icmp sgt i32 %x, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_mul_nsw1(i32 %x) {
%0:
  %mul = mul nsw i32 %x, 12
  %cmp = icmp sle i32 %mul, 4294967295
  ret i1 %cmp
}
=>
define i1 @icmp_mul_nsw1(i32 %x) {
%0:
  %cmp = icmp slt i32 %x, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_mul_nsw_neg(i32 %x) {
%0:
  %mul = mul nsw i32 %x, 4294967284
  %cmp = icmp sge i32 %mul, 0
  ret i1 %cmp
}
=>
define i1 @icmp_mul_nsw_neg(i32 %x) {
%0:
  %cmp = icmp slt i32 %x, 1
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_mul_nsw_neg1(i32 %x) {
%0:
  %mul = mul nsw i32 %x, 4294967284
  %cmp = icmp sge i32 %mul, 1
  ret i1 %cmp
}
=>
define i1 @icmp_mul_nsw_neg1(i32 %x) {
%0:
  %cmp = icmp slt i32 %x, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_mul_nsw_neg1_vec(<2 x i32> %x) {
%0:
  %mul = mul nsw <2 x i32> %x, { 4294967284, 4294967284 }
  %cmp = icmp sge <2 x i32> %mul, { 1, 1 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_mul_nsw_neg1_vec(<2 x i32> %x) {
%0:
  %cmp = icmp slt <2 x i32> %x, { 0, 0 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_mul_nsw_0(i32 %x) {
%0:
  %mul = mul nsw i32 %x, 0
  %cmp = icmp sgt i32 %mul, 0
  ret i1 %cmp
}
=>
define i1 @icmp_mul_nsw_0(i32 %x) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_mul(i32 %x) {
%0:
  %mul = mul i32 %x, 4294967284
  %cmp = icmp sge i32 %mul, 0
  ret i1 %cmp
}
=>
define i1 @icmp_mul(i32 %x) {
%0:
  %mul = mul i32 %x, 4294967284
  %cmp = icmp sgt i32 %mul, 4294967295
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_mul_neq0(i32 %x) {
%0:
  %mul = mul nsw i32 %x, 4294967284
  %cmp = icmp ne i32 %mul, 0
  ret i1 %cmp
}
=>
define i1 @icmp_mul_neq0(i32 %x) {
%0:
  %cmp = icmp ne i32 %x, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_mul_neq0_vec(<2 x i32> %x) {
%0:
  %mul = mul nsw <2 x i32> %x, { 4294967284, 4294967284 }
  %cmp = icmp ne <2 x i32> %mul, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_mul_neq0_vec(<2 x i32> %x) {
%0:
  %cmp = icmp ne <2 x i32> %x, { 0, 0 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_mul_eq0(i32 %x) {
%0:
  %mul = mul nsw i32 %x, 12
  %cmp = icmp eq i32 %mul, 0
  ret i1 %cmp
}
=>
define i1 @icmp_mul_eq0(i32 %x) {
%0:
  %cmp = icmp eq i32 %x, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_mul0_eq0(i32 %x) {
%0:
  %mul = mul i32 %x, 0
  %cmp = icmp eq i32 %mul, 0
  ret i1 %cmp
}
=>
define i1 @icmp_mul0_eq0(i32 %x) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_mul0_ne0(i32 %x) {
%0:
  %mul = mul i32 %x, 0
  %cmp = icmp ne i32 %mul, 0
  ret i1 %cmp
}
=>
define i1 @icmp_mul0_ne0(i32 %x) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sub1_sge(i32 %x, i32 %y) {
%0:
  %sub = add nsw i32 %x, 4294967295
  %cmp = icmp sge i32 %sub, %y
  ret i1 %cmp
}
=>
define i1 @icmp_sub1_sge(i32 %x, i32 %y) {
%0:
  %cmp = icmp sgt i32 %x, %y
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_add1_sgt(i32 %x, i32 %y) {
%0:
  %add = add nsw i32 %x, 1
  %cmp = icmp sgt i32 %add, %y
  ret i1 %cmp
}
=>
define i1 @icmp_add1_sgt(i32 %x, i32 %y) {
%0:
  %cmp = icmp sge i32 %x, %y
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sub1_slt(i32 %x, i32 %y) {
%0:
  %sub = add nsw i32 %x, 4294967295
  %cmp = icmp slt i32 %sub, %y
  ret i1 %cmp
}
=>
define i1 @icmp_sub1_slt(i32 %x, i32 %y) {
%0:
  %cmp = icmp sle i32 %x, %y
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_add1_sle(i32 %x, i32 %y) {
%0:
  %add = add nsw i32 %x, 1
  %cmp = icmp sle i32 %add, %y
  ret i1 %cmp
}
=>
define i1 @icmp_add1_sle(i32 %x, i32 %y) {
%0:
  %cmp = icmp slt i32 %x, %y
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_add20_sge_add57(i32 %x, i32 %y) {
%0:
  %1 = add nsw i32 %x, 20
  %2 = add nsw i32 %y, 57
  %cmp = icmp sge i32 %1, %2
  ret i1 %cmp
}
=>
define i1 @icmp_add20_sge_add57(i32 %x, i32 %y) {
%0:
  %1 = add nsw i32 %y, 37
  %cmp = icmp sle i32 %1, %x
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sub57_sge_sub20(i32 %x, i32 %y) {
%0:
  %1 = add nsw i32 %x, 4294967239
  %2 = add nsw i32 %y, 4294967276
  %cmp = icmp sge i32 %1, %2
  ret i1 %cmp
}
=>
define i1 @icmp_sub57_sge_sub20(i32 %x, i32 %y) {
%0:
  %1 = add nsw i32 %x, 4294967259
  %cmp = icmp sge i32 %1, %y
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_shl_neg_ne_0(i32 %A, i32 %B) {
%0:
  %neg = xor i32 %A, 4294967295
  %shl = shl i32 1, %B
  %and = and i32 %shl, %neg
  %cmp = icmp ne i32 %and, 0
  ret i1 %cmp
}
=>
define i1 @icmp_and_shl_neg_ne_0(i32 %A, i32 %B) {
%0:
  %shl = shl i32 1, %B
  %1 = and i32 %shl, %A
  %cmp = icmp eq i32 %1, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_shl_neg_eq_0(i32 %A, i32 %B) {
%0:
  %neg = xor i32 %A, 4294967295
  %shl = shl i32 1, %B
  %and = and i32 %shl, %neg
  %cmp = icmp eq i32 %and, 0
  ret i1 %cmp
}
=>
define i1 @icmp_and_shl_neg_eq_0(i32 %A, i32 %B) {
%0:
  %shl = shl i32 1, %B
  %1 = and i32 %shl, %A
  %cmp = icmp ne i32 %1, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_add_and_shr_ne_0(i32 %X) {
%0:
  %shr = lshr i32 %X, 4
  %and = and i32 %shr, 15
  %add = add i32 %and, 4294967282
  %tobool = icmp ne i32 %add, 0
  ret i1 %tobool
}
=>
define i1 @icmp_add_and_shr_ne_0(i32 %X) {
%0:
  %1 = and i32 %X, 240
  %tobool = icmp ne i32 %1, 224
  ret i1 %tobool
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_add_and_shr_ne_0_vec(<2 x i32> %X) {
%0:
  %shr = lshr <2 x i32> %X, { 4, 4 }
  %and = and <2 x i32> %shr, { 15, 15 }
  %add = add <2 x i32> %and, { 4294967282, 4294967282 }
  %tobool = icmp ne <2 x i32> %add, { 0, 0 }
  ret <2 x i1> %tobool
}
=>
define <2 x i1> @icmp_add_and_shr_ne_0_vec(<2 x i32> %X) {
%0:
  %1 = and <2 x i32> %X, { 240, 240 }
  %tobool = icmp ne <2 x i32> %1, { 224, 224 }
  ret <2 x i1> %tobool
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_shr_multiuse(i32 %X) {
%0:
  %shr = lshr i32 %X, 4
  %and = and i32 %shr, 15
  %and2 = and i32 %shr, 31
  %tobool = icmp ne i32 %and, 14
  %tobool2 = icmp ne i32 %and2, 27
  %and3 = and i1 %tobool, %tobool2
  ret i1 %and3
}
=>
define i1 @icmp_and_shr_multiuse(i32 %X) {
%0:
  %1 = and i32 %X, 240
  %tobool = icmp ne i32 %1, 224
  %2 = and i32 %X, 496
  %tobool2 = icmp ne i32 %2, 432
  %and3 = and i1 %tobool, %tobool2
  ret i1 %and3
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_ashr_multiuse(i32 %X) {
%0:
  %shr = ashr i32 %X, 4
  %and = and i32 %shr, 15
  %and2 = and i32 %shr, 31
  %tobool = icmp ne i32 %and, 14
  %tobool2 = icmp ne i32 %and2, 27
  %and3 = and i1 %tobool, %tobool2
  ret i1 %and3
}
=>
define i1 @icmp_and_ashr_multiuse(i32 %X) {
%0:
  %1 = and i32 %X, 240
  %tobool = icmp ne i32 %1, 224
  %2 = and i32 %X, 496
  %tobool2 = icmp ne i32 %2, 432
  %and3 = and i1 %tobool, %tobool2
  ret i1 %and3
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_lshr_and_overshift(i8 %X) {
%0:
  %shr = lshr i8 %X, 5
  %and = and i8 %shr, 15
  %tobool = icmp ne i8 %and, 0
  ret i1 %tobool
}
=>
define i1 @icmp_lshr_and_overshift(i8 %X) {
%0:
  %tobool = icmp ugt i8 %X, 31
  ret i1 %tobool
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_ashr_and_overshift(i8 %X) {
%0:
  %shr = ashr i8 %X, 5
  %and = and i8 %shr, 15
  %tobool = icmp ne i8 %and, 0
  ret i1 %tobool
}
=>
define i1 @icmp_ashr_and_overshift(i8 %X) {
%0:
  %shr = ashr i8 %X, 5
  %and = and i8 %shr, 15
  %tobool = icmp ne i8 %and, 0
  ret i1 %tobool
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_ashr_neg_and_legal(i8 %x) {
%0:
  %ashr = ashr i8 %x, 4
  %and = and i8 %ashr, 254
  %cmp = icmp slt i8 %and, 1
  ret i1 %cmp
}
=>
define i1 @icmp_and_ashr_neg_and_legal(i8 %x) {
%0:
  %1 = and i8 %x, 224
  %cmp = icmp slt i8 %1, 16
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_ashr_mixed_and_shiftout(i8 %x) {
%0:
  %ashr = ashr i8 %x, 4
  %and = and i8 %ashr, 31
  %cmp = icmp ugt i8 %and, 8
  ret i1 %cmp
}
=>
define i1 @icmp_and_ashr_mixed_and_shiftout(i8 %x) {
%0:
  %ashr = ashr i8 %x, 4
  %and = and i8 %ashr, 31
  %cmp = icmp ugt i8 %and, 8
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_ashr_neg_cmp_slt_legal(i8 %x) {
%0:
  %ashr = ashr i8 %x, 4
  %and = and i8 %ashr, 254
  %cmp = icmp slt i8 %and, 252
  ret i1 %cmp
}
=>
define i1 @icmp_and_ashr_neg_cmp_slt_legal(i8 %x) {
%0:
  %1 = and i8 %x, 224
  %cmp = icmp slt i8 %1, 192
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_ashr_neg_cmp_slt_shiftout(i8 %x) {
%0:
  %ashr = ashr i8 %x, 4
  %and = and i8 %ashr, 254
  %cmp = icmp slt i8 %and, 188
  ret i1 %cmp
}
=>
define i1 @icmp_and_ashr_neg_cmp_slt_shiftout(i8 %x) {
%0:
  %ashr = ashr i8 %x, 4
  %and = and i8 %ashr, 254
  %cmp = icmp slt i8 %and, 188
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_ashr_neg_cmp_eq_legal(i8 %x) {
%0:
  %ashr = ashr i8 %x, 4
  %and = and i8 %ashr, 254
  %cmp = icmp eq i8 %and, 252
  ret i1 %cmp
}
=>
define i1 @icmp_and_ashr_neg_cmp_eq_legal(i8 %x) {
%0:
  %1 = and i8 %x, 224
  %cmp = icmp eq i8 %1, 192
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_ashr_neg_cmp_eq_shiftout(i8 %x) {
%0:
  %ashr = ashr i8 %x, 4
  %and = and i8 %ashr, 254
  %cmp = icmp eq i8 %and, 188
  ret i1 %cmp
}
=>
define i1 @icmp_and_ashr_neg_cmp_eq_shiftout(i8 %x) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_ashr_neg_cmp_ne_shiftout(i8 %x) {
%0:
  %ashr = ashr i8 %x, 4
  %and = and i8 %ashr, 254
  %cmp = icmp ne i8 %and, 188
  ret i1 %cmp
}
=>
define i1 @icmp_and_ashr_neg_cmp_ne_shiftout(i8 %x) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @test71(* %x) {
%0:
  %a = gep * %x, 1 x i64 8
  %b = gep inbounds * %x, 1 x i64 8
  %c = icmp ugt * %a, %b
  ret i1 %c
}
=>
define i1 @test71(* %x) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl_1_V_ult_32(i32 %V) {
%0:
  %shl = shl i32 1, %V
  %cmp = icmp ult i32 %shl, 32
  ret i1 %cmp
}
=>
define i1 @icmp_shl_1_V_ult_32(i32 %V) {
%0:
  %cmp = icmp ult i32 %V, 5
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_1_V_ult_32_vec(<2 x i32> %V) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %V
  %cmp = icmp ult <2 x i32> %shl, { 32, 32 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_1_V_ult_32_vec(<2 x i32> %V) {
%0:
  %cmp = icmp ult <2 x i32> %V, { 5, 5 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl_1_V_eq_32(i32 %V) {
%0:
  %shl = shl i32 1, %V
  %cmp = icmp eq i32 %shl, 32
  ret i1 %cmp
}
=>
define i1 @icmp_shl_1_V_eq_32(i32 %V) {
%0:
  %cmp = icmp eq i32 %V, 5
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_1_V_eq_32_vec(<2 x i32> %V) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %V
  %cmp = icmp eq <2 x i32> %shl, { 32, 32 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_1_V_eq_32_vec(<2 x i32> %V) {
%0:
  %cmp = icmp eq <2 x i32> %V, { 5, 5 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl_1_V_ult_30(i32 %V) {
%0:
  %shl = shl i32 1, %V
  %cmp = icmp ult i32 %shl, 30
  ret i1 %cmp
}
=>
define i1 @icmp_shl_1_V_ult_30(i32 %V) {
%0:
  %cmp = icmp ult i32 %V, 5
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_1_V_ult_30_vec(<2 x i32> %V) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %V
  %cmp = icmp ult <2 x i32> %shl, { 30, 30 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_1_V_ult_30_vec(<2 x i32> %V) {
%0:
  %cmp = icmp ult <2 x i32> %V, { 5, 5 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl_1_V_ugt_30(i32 %V) {
%0:
  %shl = shl i32 1, %V
  %cmp = icmp ugt i32 %shl, 30
  ret i1 %cmp
}
=>
define i1 @icmp_shl_1_V_ugt_30(i32 %V) {
%0:
  %cmp = icmp ugt i32 %V, 4
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_1_V_ugt_30_vec(<2 x i32> %V) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %V
  %cmp = icmp ugt <2 x i32> %shl, { 30, 30 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_1_V_ugt_30_vec(<2 x i32> %V) {
%0:
  %cmp = icmp ugt <2 x i32> %V, { 4, 4 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl_1_V_ule_30(i32 %V) {
%0:
  %shl = shl i32 1, %V
  %cmp = icmp ule i32 %shl, 30
  ret i1 %cmp
}
=>
define i1 @icmp_shl_1_V_ule_30(i32 %V) {
%0:
  %cmp = icmp ult i32 %V, 5
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_1_V_ule_30_vec(<2 x i32> %V) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %V
  %cmp = icmp ule <2 x i32> %shl, { 30, 30 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_1_V_ule_30_vec(<2 x i32> %V) {
%0:
  %cmp = icmp ult <2 x i32> %V, { 5, 5 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl_1_V_uge_30(i32 %V) {
%0:
  %shl = shl i32 1, %V
  %cmp = icmp uge i32 %shl, 30
  ret i1 %cmp
}
=>
define i1 @icmp_shl_1_V_uge_30(i32 %V) {
%0:
  %cmp = icmp ugt i32 %V, 4
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_1_V_uge_30_vec(<2 x i32> %V) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %V
  %cmp = icmp uge <2 x i32> %shl, { 30, 30 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_1_V_uge_30_vec(<2 x i32> %V) {
%0:
  %cmp = icmp ugt <2 x i32> %V, { 4, 4 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl_1_V_uge_2147483648(i32 %V) {
%0:
  %shl = shl i32 1, %V
  %cmp = icmp uge i32 %shl, 2147483648
  ret i1 %cmp
}
=>
define i1 @icmp_shl_1_V_uge_2147483648(i32 %V) {
%0:
  %cmp = icmp eq i32 %V, 31
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_1_V_uge_2147483648_vec(<2 x i32> %V) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %V
  %cmp = icmp uge <2 x i32> %shl, { 2147483648, 2147483648 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_1_V_uge_2147483648_vec(<2 x i32> %V) {
%0:
  %cmp = icmp eq <2 x i32> %V, { 31, 31 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_shl_1_V_ult_2147483648(i32 %V) {
%0:
  %shl = shl i32 1, %V
  %cmp = icmp ult i32 %shl, 2147483648
  ret i1 %cmp
}
=>
define i1 @icmp_shl_1_V_ult_2147483648(i32 %V) {
%0:
  %cmp = icmp ne i32 %V, 31
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_shl_1_V_ult_2147483648_vec(<2 x i32> %V) {
%0:
  %shl = shl <2 x i32> { 1, 1 }, %V
  %cmp = icmp ult <2 x i32> %shl, { 2147483648, 2147483648 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_shl_1_V_ult_2147483648_vec(<2 x i32> %V) {
%0:
  %cmp = icmp ne <2 x i32> %V, { 31, 31 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @or_icmp_eq_B_0_icmp_ult_A_B(i64 %a, i64 %b) {
%0:
  %1 = icmp eq i64 %b, 0
  %2 = icmp ult i64 %a, %b
  %3 = or i1 %1, %2
  ret i1 %3
}
=>
define i1 @or_icmp_eq_B_0_icmp_ult_A_B(i64 %a, i64 %b) {
%0:
  %1 = add i64 %b, -1
  %2 = icmp uge i64 %1, %a
  ret i1 %2
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @or_icmp_eq_B_0_icmp_ult_A_B_uniform(<2 x i64> %a, <2 x i64> %b) {
%0:
  %1 = icmp eq <2 x i64> %b, { 0, 0 }
  %2 = icmp ult <2 x i64> %a, %b
  %3 = or <2 x i1> %1, %2
  ret <2 x i1> %3
}
=>
define <2 x i1> @or_icmp_eq_B_0_icmp_ult_A_B_uniform(<2 x i64> %a, <2 x i64> %b) {
%0:
  %1 = add <2 x i64> %b, { -1, -1 }
  %2 = icmp uge <2 x i64> %1, %a
  ret <2 x i1> %2
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @or_icmp_eq_B_0_icmp_ult_A_B_undef(<2 x i64> %a, <2 x i64> %b) {
%0:
  %1 = icmp eq <2 x i64> %b, { 0, undef }
  %2 = icmp ult <2 x i64> %a, %b
  %3 = or <2 x i1> %1, %2
  ret <2 x i1> %3
}
=>
define <2 x i1> @or_icmp_eq_B_0_icmp_ult_A_B_undef(<2 x i64> %a, <2 x i64> %b) {
%0:
  %1 = add <2 x i64> %b, { -1, -1 }
  %2 = icmp uge <2 x i64> %1, %a
  ret <2 x i1> %2
}
Transformation seems to be correct!


----------------------------------------
define i1 @or_icmp_ne_A_0_icmp_ne_B_0(i64 %a, i64 %b) {
%0:
  %1 = icmp ne i64 %a, 0
  %2 = icmp ne i64 %b, 0
  %3 = or i1 %1, %2
  ret i1 %3
}
=>
define i1 @or_icmp_ne_A_0_icmp_ne_B_0(i64 %a, i64 %b) {
%0:
  %1 = or i64 %a, %b
  %2 = icmp ne i64 %1, 0
  ret i1 %2
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @or_icmp_ne_A_0_icmp_ne_B_0_uniform(<2 x i64> %a, <2 x i64> %b) {
%0:
  %1 = icmp ne <2 x i64> %a, { 0, 0 }
  %2 = icmp ne <2 x i64> %b, { 0, 0 }
  %3 = or <2 x i1> %1, %2
  ret <2 x i1> %3
}
=>
define <2 x i1> @or_icmp_ne_A_0_icmp_ne_B_0_uniform(<2 x i64> %a, <2 x i64> %b) {
%0:
  %1 = or <2 x i64> %a, %b
  %2 = icmp ne <2 x i64> %1, { 0, 0 }
  ret <2 x i1> %2
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @or_icmp_ne_A_0_icmp_ne_B_0_undef(<2 x i64> %a, <2 x i64> %b) {
%0:
  %1 = icmp ne <2 x i64> %a, { 0, undef }
  %2 = icmp ne <2 x i64> %b, { 0, undef }
  %3 = or <2 x i1> %1, %2
  ret <2 x i1> %3
}
=>
define <2 x i1> @or_icmp_ne_A_0_icmp_ne_B_0_undef(<2 x i64> %a, <2 x i64> %b) {
%0:
  %1 = or <2 x i64> %a, %b
  %2 = icmp ne <2 x i64> %1, { 0, 0 }
  ret <2 x i1> %2
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_add_ult_2(i32 %X) {
%0:
  %add = add i32 %X, 4294967282
  %cmp = icmp ult i32 %add, 2
  ret i1 %cmp
}
=>
define i1 @icmp_add_ult_2(i32 %X) {
%0:
  %1 = and i32 %X, 4294967294
  %cmp = icmp eq i32 %1, 14
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_add_X_-14_ult_2_vec(<2 x i32> %X) {
%0:
  %add = add <2 x i32> %X, { 4294967282, 4294967282 }
  %cmp = icmp ult <2 x i32> %add, { 2, 2 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_add_X_-14_ult_2_vec(<2 x i32> %X) {
%0:
  %1 = and <2 x i32> %X, { 4294967294, 4294967294 }
  %cmp = icmp eq <2 x i32> %1, { 14, 14 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sub_3_X_ult_2(i32 %X) {
%0:
  %add = sub i32 3, %X
  %cmp = icmp ult i32 %add, 2
  ret i1 %cmp
}
=>
define i1 @icmp_sub_3_X_ult_2(i32 %X) {
%0:
  %1 = and i32 %X, 4294967294
  %cmp = icmp eq i32 %1, 2
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_sub_3_X_ult_2_vec(<2 x i32> %X) {
%0:
  %add = sub <2 x i32> { 3, 3 }, %X
  %cmp = icmp ult <2 x i32> %add, { 2, 2 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_sub_3_X_ult_2_vec(<2 x i32> %X) {
%0:
  %1 = and <2 x i32> %X, { 4294967294, 4294967294 }
  %cmp = icmp eq <2 x i32> %1, { 2, 2 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_add_X_-14_uge_2(i32 %X) {
%0:
  %add = add i32 %X, 4294967282
  %cmp = icmp uge i32 %add, 2
  ret i1 %cmp
}
=>
define i1 @icmp_add_X_-14_uge_2(i32 %X) {
%0:
  %1 = and i32 %X, 4294967294
  %cmp = icmp ne i32 %1, 14
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_add_X_-14_uge_2_vec(<2 x i32> %X) {
%0:
  %add = add <2 x i32> %X, { 4294967282, 4294967282 }
  %cmp = icmp uge <2 x i32> %add, { 2, 2 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_add_X_-14_uge_2_vec(<2 x i32> %X) {
%0:
  %1 = and <2 x i32> %X, { 4294967294, 4294967294 }
  %cmp = icmp ne <2 x i32> %1, { 14, 14 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sub_3_X_uge_2(i32 %X) {
%0:
  %add = sub i32 3, %X
  %cmp = icmp uge i32 %add, 2
  ret i1 %cmp
}
=>
define i1 @icmp_sub_3_X_uge_2(i32 %X) {
%0:
  %1 = and i32 %X, 4294967294
  %cmp = icmp ne i32 %1, 2
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_sub_3_X_uge_2_vec(<2 x i32> %X) {
%0:
  %add = sub <2 x i32> { 3, 3 }, %X
  %cmp = icmp uge <2 x i32> %add, { 2, 2 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_sub_3_X_uge_2_vec(<2 x i32> %X) {
%0:
  %1 = and <2 x i32> %X, { 4294967294, 4294967294 }
  %cmp = icmp ne <2 x i32> %1, { 2, 2 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_X_-16_eq-16(i32 %X) {
%0:
  %and = and i32 %X, 4294967280
  %cmp = icmp eq i32 %and, 4294967280
  ret i1 %cmp
}
=>
define i1 @icmp_and_X_-16_eq-16(i32 %X) {
%0:
  %cmp = icmp ugt i32 %X, 4294967279
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_and_X_-16_eq-16_vec(<2 x i32> %X) {
%0:
  %and = and <2 x i32> %X, { 4294967280, 4294967280 }
  %cmp = icmp eq <2 x i32> %and, { 4294967280, 4294967280 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_and_X_-16_eq-16_vec(<2 x i32> %X) {
%0:
  %cmp = icmp ugt <2 x i32> %X, { 4294967279, 4294967279 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_X_-16_ne-16(i32 %X) {
%0:
  %and = and i32 %X, 4294967280
  %cmp = icmp ne i32 %and, 4294967280
  ret i1 %cmp
}
=>
define i1 @icmp_and_X_-16_ne-16(i32 %X) {
%0:
  %cmp = icmp ult i32 %X, 4294967280
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_and_X_-16_ne-16_vec(<2 x i32> %X) {
%0:
  %and = and <2 x i32> %X, { 4294967280, 4294967280 }
  %cmp = icmp ne <2 x i32> %and, { 4294967280, 4294967280 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_and_X_-16_ne-16_vec(<2 x i32> %X) {
%0:
  %cmp = icmp ult <2 x i32> %X, { 4294967280, 4294967280 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @or1_eq1(i32 %x) {
%0:
  %t0 = or i32 %x, 1
  %t1 = icmp eq i32 %t0, 1
  ret i1 %t1
}
=>
define i1 @or1_eq1(i32 %x) {
%0:
  %t1 = icmp ult i32 %x, 2
  ret i1 %t1
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @or3_eq3_vec(<2 x i8> %x) {
%0:
  %t0 = or <2 x i8> %x, { 3, 3 }
  %t1 = icmp eq <2 x i8> %t0, { 3, 3 }
  ret <2 x i1> %t1
}
=>
define <2 x i1> @or3_eq3_vec(<2 x i8> %x) {
%0:
  %t1 = icmp ult <2 x i8> %x, { 4, 4 }
  ret <2 x i1> %t1
}
Transformation seems to be correct!


----------------------------------------
define i1 @or7_ne7(i32 %x) {
%0:
  %t0 = or i32 %x, 7
  %t1 = icmp ne i32 %t0, 7
  ret i1 %t1
}
=>
define i1 @or7_ne7(i32 %x) {
%0:
  %t1 = icmp ugt i32 %x, 7
  ret i1 %t1
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @or63_ne63_vec(<2 x i8> %x) {
%0:
  %t0 = or <2 x i8> %x, { 63, 63 }
  %t1 = icmp ne <2 x i8> %t0, { 63, 63 }
  ret <2 x i1> %t1
}
=>
define <2 x i1> @or63_ne63_vec(<2 x i8> %x) {
%0:
  %t1 = icmp ugt <2 x i8> %x, { 63, 63 }
  ret <2 x i1> %t1
}
Transformation seems to be correct!


----------------------------------------
define i1 @orC_eqC(i32 %x) {
%0:
  %t0 = or i32 %x, 42
  %t1 = icmp eq i32 %t0, 42
  ret i1 %t1
}
=>
define i1 @orC_eqC(i32 %x) {
%0:
  %1 = and i32 %x, 4294967253
  %t1 = icmp eq i32 %1, 0
  ret i1 %t1
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @orC_eqC_vec(<2 x i8> %x) {
%0:
  %t0 = or <2 x i8> %x, { 43, 43 }
  %t1 = icmp eq <2 x i8> %t0, { 43, 43 }
  ret <2 x i1> %t1
}
=>
define <2 x i1> @orC_eqC_vec(<2 x i8> %x) {
%0:
  %1 = and <2 x i8> %x, { 212, 212 }
  %t1 = icmp eq <2 x i8> %1, { 0, 0 }
  ret <2 x i1> %t1
}
Transformation seems to be correct!


----------------------------------------
define i1 @orC_neC(i32 %x) {
%0:
  %t0 = or i32 %x, 4294967254
  %t1 = icmp ne i32 %t0, 4294967254
  ret i1 %t1
}
=>
define i1 @orC_neC(i32 %x) {
%0:
  %1 = and i32 %x, 41
  %t1 = icmp ne i32 %1, 0
  ret i1 %t1
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @orC_neC_vec(<2 x i8> %x) {
%0:
  %t0 = or <2 x i8> %x, { 213, 213 }
  %t1 = icmp ne <2 x i8> %t0, { 213, 213 }
  ret <2 x i1> %t1
}
=>
define <2 x i1> @orC_neC_vec(<2 x i8> %x) {
%0:
  %1 = and <2 x i8> %x, { 42, 42 }
  %t1 = icmp ne <2 x i8> %1, { 0, 0 }
  ret <2 x i1> %t1
}
Transformation seems to be correct!


----------------------------------------
define i1 @shrink_constant(i32 %X) {
%0:
  %xor = xor i32 %X, 4294967287
  %cmp = icmp ult i32 %xor, 4
  ret i1 %cmp
}
=>
define i1 @shrink_constant(i32 %X) {
%0:
  %xor = xor i32 %X, 4294967284
  %cmp = icmp ult i32 %xor, 4
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @shrink_constant_vec(<2 x i32> %X) {
%0:
  %xor = xor <2 x i32> %X, { 4294967287, 4294967287 }
  %cmp = icmp ult <2 x i32> %xor, { 4, 4 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @shrink_constant_vec(<2 x i32> %X) {
%0:
  %xor = xor <2 x i32> %X, { 4294967284, 4294967284 }
  %cmp = icmp ult <2 x i32> %xor, { 4, 4 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sub_-1_X_ult_4(i32 %X) {
%0:
  %sub = sub i32 4294967295, %X
  %cmp = icmp ult i32 %sub, 4
  ret i1 %cmp
}
=>
define i1 @icmp_sub_-1_X_ult_4(i32 %X) {
%0:
  %cmp = icmp ugt i32 %X, 4294967291
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_xor_neg4_X_ult_4_vec(<2 x i32> %X) {
%0:
  %xor = xor <2 x i32> %X, { 4294967292, 4294967292 }
  %cmp = icmp ult <2 x i32> %xor, { 4, 4 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_xor_neg4_X_ult_4_vec(<2 x i32> %X) {
%0:
  %cmp = icmp ugt <2 x i32> %X, { 4294967291, 4294967291 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sub_-1_X_uge_4(i32 %X) {
%0:
  %sub = sub i32 4294967295, %X
  %cmp = icmp uge i32 %sub, 4
  ret i1 %cmp
}
=>
define i1 @icmp_sub_-1_X_uge_4(i32 %X) {
%0:
  %cmp = icmp ult i32 %X, 4294967292
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_xor_neg4_X_uge_4_vec(<2 x i32> %X) {
%0:
  %xor = xor <2 x i32> %X, { 4294967292, 4294967292 }
  %cmp = icmp uge <2 x i32> %xor, { 4, 4 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @icmp_xor_neg4_X_uge_4_vec(<2 x i32> %X) {
%0:
  %cmp = icmp ult <2 x i32> %X, { 4294967292, 4294967292 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @xor_ult(<2 x i8> %x) {
%0:
  %xor = xor <2 x i8> %x, { 252, 252 }
  %r = icmp ult <2 x i8> %xor, { 252, 252 }
  ret <2 x i1> %r
}
=>
define <2 x i1> @xor_ult(<2 x i8> %x) {
%0:
  %r = icmp ugt <2 x i8> %x, { 3, 3 }
  ret <2 x i1> %r
}
Transformation seems to be correct!


----------------------------------------
define i1 @xor_ult_extra_use(i8 %x, * %p) {
%0:
  %xor = xor i8 %x, 224
  store i8 %xor, * %p, align 1
  %r = icmp ult i8 %xor, 224
  ret i1 %r
}
=>
define i1 @xor_ult_extra_use(i8 %x, * %p) {
%0:
  %xor = xor i8 %x, 224
  store i8 %xor, * %p, align 1
  %r = icmp ugt i8 %x, 31
  ret i1 %r
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @xor_ugt(<2 x i8> %x) {
%0:
  %xor = xor <2 x i8> %x, { 7, 7 }
  %r = icmp ugt <2 x i8> %xor, { 7, 7 }
  ret <2 x i1> %r
}
=>
define <2 x i1> @xor_ugt(<2 x i8> %x) {
%0:
  %r = icmp ugt <2 x i8> %x, { 7, 7 }
  ret <2 x i1> %r
}
Transformation seems to be correct!


----------------------------------------
define i1 @xor_ugt_extra_use(i8 %x, * %p) {
%0:
  %xor = xor i8 %x, 63
  store i8 %xor, * %p, align 1
  %r = icmp ugt i8 %xor, 63
  ret i1 %r
}
=>
define i1 @xor_ugt_extra_use(i8 %x, * %p) {
%0:
  %xor = xor i8 %x, 63
  store i8 %xor, * %p, align 1
  %r = icmp ugt i8 %x, 63
  ret i1 %r
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_swap_operands_for_cse(i32 %X, i32 %Y) {
%entry:
  %sub = sub i32 %X, %Y
  %cmp = icmp ugt i32 %Y, %X
  br i1 %cmp, label %true, label %false

%false:
  %shift = lshr i32 %sub, 4
  %resfalse = trunc i32 %shift to i1
  br label %end

%true:
  %restrue = trunc i32 %sub to i1
  br label %end

%end:
  %res = phi i1 [ %restrue, %true ], [ %resfalse, %false ]
  ret i1 %res
}
=>
define i1 @icmp_swap_operands_for_cse(i32 %X, i32 %Y) {
%entry:
  %sub = sub i32 %X, %Y
  %cmp = icmp ult i32 %X, %Y
  br i1 %cmp, label %true, label %false

%false:
  %0 = and i32 %sub, 16
  br label %end

%true:
  %1 = and i32 %sub, 1
  br label %end

%end:
  %res.in = phi i32 [ %1, %true ], [ %0, %false ]
  %res = icmp ne i32 %res.in, 0
  ret i1 %res
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_swap_operands_for_cse2(i32 %X, i32 %Y) {
%entry:
  %cmp = icmp ugt i32 %Y, %X
  br i1 %cmp, label %true, label %false

%false:
  %sub2 = sub i32 %Y, %X
  %resfalse = trunc i32 %sub2 to i1
  br label %end

%true:
  %sub = sub i32 %X, %Y
  %sub1 = sub i32 %X, %Y
  %add = add i32 %sub, %sub1
  %restrue = trunc i32 %add to i1
  br label %end

%end:
  %res = phi i1 [ %restrue, %true ], [ %resfalse, %false ]
  ret i1 %res
}
=>
define i1 @icmp_swap_operands_for_cse2(i32 %X, i32 %Y) {
%entry:
  %cmp = icmp ult i32 %X, %Y
  br i1 %cmp, label %true, label %false

%false:
  %sub2 = sub i32 %Y, %X
  br label %end

%true:
  %sub = sub i32 %X, %Y
  %sub1 = sub i32 %X, %Y
  %add = add i32 %sub, %sub1
  br label %end

%end:
  %res.in.in = phi i32 [ %add, %true ], [ %sub2, %false ]
  %res.in = and i32 %res.in.in, 1
  %res = icmp ne i32 %res.in, 0
  ret i1 %res
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_do_not_swap_operands_for_cse(i32 %X, i32 %Y) {
%entry:
  %cmp = icmp ugt i32 %Y, %X
  br i1 %cmp, label %true, label %false

%false:
  %sub2 = sub i32 %Y, %X
  %resfalse = trunc i32 %sub2 to i1
  br label %end

%true:
  %sub = sub i32 %X, %Y
  %restrue = trunc i32 %sub to i1
  br label %end

%end:
  %res = phi i1 [ %restrue, %true ], [ %resfalse, %false ]
  ret i1 %res
}
=>
define i1 @icmp_do_not_swap_operands_for_cse(i32 %X, i32 %Y) {
%entry:
  %cmp = icmp ugt i32 %Y, %X
  br i1 %cmp, label %true, label %false

%false:
  %sub2 = sub i32 %Y, %X
  br label %end

%true:
  %sub = sub i32 %X, %Y
  br label %end

%end:
  %res.in.in = phi i32 [ %sub, %true ], [ %sub2, %false ]
  %res.in = and i32 %res.in.in, 1
  %res = icmp ne i32 %res.in, 0
  ret i1 %res
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_lshr_lshr_eq(i32 %a, i32 %b) {
%0:
  %x = lshr i32 %a, 30
  %y = lshr i32 %b, 30
  %z = icmp eq i32 %x, %y
  ret i1 %z
}
=>
define i1 @icmp_lshr_lshr_eq(i32 %a, i32 %b) {
%0:
  %z.unshifted = xor i32 %a, %b
  %z = icmp ult i32 %z.unshifted, 1073741824
  ret i1 %z
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_ashr_ashr_ne(i32 %a, i32 %b) {
%0:
  %x = ashr i32 %a, 8
  %y = ashr i32 %b, 8
  %z = icmp ne i32 %x, %y
  ret i1 %z
}
=>
define i1 @icmp_ashr_ashr_ne(i32 %a, i32 %b) {
%0:
  %z.unshifted = xor i32 %a, %b
  %z = icmp ugt i32 %z.unshifted, 255
  ret i1 %z
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_neg_cst_slt(i32 %a) {
%0:
  %1 = sub nsw i32 0, %a
  %2 = icmp slt i32 %1, 4294967286
  ret i1 %2
}
=>
define i1 @icmp_neg_cst_slt(i32 %a) {
%0:
  %1 = icmp sgt i32 %a, 10
  ret i1 %1
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_or_lshr(i32 %x, i32 %y) {
%0:
  %shf = lshr i32 %x, %y
  %or = or i32 %shf, %x
  %and = and i32 %or, 1
  %ret = icmp ne i32 %and, 0
  ret i1 %ret
}
=>
define i1 @icmp_and_or_lshr(i32 %x, i32 %y) {
%0:
  %shf1 = shl nuw i32 1, %y
  %or2 = or i32 %shf1, 1
  %and3 = and i32 %or2, %x
  %ret = icmp ne i32 %and3, 0
  ret i1 %ret
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_and_or_lshr_vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %shf = lshr <2 x i32> %x, %y
  %or = or <2 x i32> %shf, %x
  %and = and <2 x i32> %or, { 1, 1 }
  %ret = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %ret
}
=>
define <2 x i1> @icmp_and_or_lshr_vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %shf = lshr <2 x i32> %x, %y
  %or = or <2 x i32> %shf, %x
  %ret = trunc <2 x i32> %or to <2 x i1>
  ret <2 x i1> %ret
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_and_or_lshr_vec_commute(<2 x i32> %xp, <2 x i32> %y) {
%0:
  %x = srem <2 x i32> %xp, { 42, 4294967254 }
  %shf = lshr <2 x i32> %x, %y
  %or = or <2 x i32> %x, %shf
  %and = and <2 x i32> %or, { 1, 1 }
  %ret = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %ret
}
=>
define <2 x i1> @icmp_and_or_lshr_vec_commute(<2 x i32> %xp, <2 x i32> %y) {
%0:
  %x = srem <2 x i32> %xp, { 42, 42 }
  %shf = lshr <2 x i32> %x, %y
  %or = or <2 x i32> %x, %shf
  %ret = trunc <2 x i32> %or to <2 x i1>
  ret <2 x i1> %ret
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_and_or_lshr_cst(i32 %x) {
%0:
  %shf = lshr i32 %x, 1
  %or = or i32 %shf, %x
  %and = and i32 %or, 1
  %ret = icmp ne i32 %and, 0
  ret i1 %ret
}
=>
define i1 @icmp_and_or_lshr_cst(i32 %x) {
%0:
  %and1 = and i32 %x, 3
  %ret = icmp ne i32 %and1, 0
  ret i1 %ret
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_and_or_lshr_cst_vec(<2 x i32> %x) {
%0:
  %shf = lshr <2 x i32> %x, { 1, 1 }
  %or = or <2 x i32> %shf, %x
  %and = and <2 x i32> %or, { 1, 1 }
  %ret = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %ret
}
=>
define <2 x i1> @icmp_and_or_lshr_cst_vec(<2 x i32> %x) {
%0:
  %1 = and <2 x i32> %x, { 3, 3 }
  %ret = icmp ne <2 x i32> %1, { 0, 0 }
  ret <2 x i1> %ret
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_and_or_lshr_cst_vec_nonuniform(<2 x i32> %x) {
%0:
  %shf = lshr <2 x i32> %x, { 1, 2 }
  %or = or <2 x i32> %shf, %x
  %and = and <2 x i32> %or, { 1, 1 }
  %ret = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %ret
}
=>
define <2 x i1> @icmp_and_or_lshr_cst_vec_nonuniform(<2 x i32> %x) {
%0:
  %1 = and <2 x i32> %x, { 3, 5 }
  %ret = icmp ne <2 x i32> %1, { 0, 0 }
  ret <2 x i1> %ret
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_and_or_lshr_cst_vec_undef(<2 x i32> %x) {
%0:
  %shf = lshr <2 x i32> %x, { 1, undef }
  %or = or <2 x i32> %shf, %x
  %and = and <2 x i32> %or, { 1, 1 }
  %ret = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %ret
}
=>
define <2 x i1> @icmp_and_or_lshr_cst_vec_undef(<2 x i32> %x) {
%0:
  %1 = and <2 x i32> %x, { 3, poison }
  %ret = icmp ne <2 x i32> %1, { 0, 0 }
  ret <2 x i1> %ret
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_and_or_lshr_cst_vec_commute(<2 x i32> %xp) {
%0:
  %x = srem <2 x i32> %xp, { 42, 4294967254 }
  %shf = lshr <2 x i32> %x, { 1, 1 }
  %or = or <2 x i32> %x, %shf
  %and = and <2 x i32> %or, { 1, 1 }
  %ret = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %ret
}
=>
define <2 x i1> @icmp_and_or_lshr_cst_vec_commute(<2 x i32> %xp) {
%0:
  %x = srem <2 x i32> %xp, { 42, 42 }
  %1 = and <2 x i32> %x, { 3, 3 }
  %ret = icmp ne <2 x i32> %1, { 0, 0 }
  ret <2 x i1> %ret
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_and_or_lshr_cst_vec_nonuniform_commute(<2 x i32> %xp) {
%0:
  %x = srem <2 x i32> %xp, { 42, 4294967254 }
  %shf = lshr <2 x i32> %x, { 1, 2 }
  %or = or <2 x i32> %x, %shf
  %and = and <2 x i32> %or, { 1, 1 }
  %ret = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %ret
}
=>
define <2 x i1> @icmp_and_or_lshr_cst_vec_nonuniform_commute(<2 x i32> %xp) {
%0:
  %x = srem <2 x i32> %xp, { 42, 42 }
  %1 = and <2 x i32> %x, { 3, 5 }
  %ret = icmp ne <2 x i32> %1, { 0, 0 }
  ret <2 x i1> %ret
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @icmp_and_or_lshr_cst_vec_undef_commute(<2 x i32> %xp) {
%0:
  %x = srem <2 x i32> %xp, { 42, 4294967254 }
  %shf = lshr <2 x i32> %x, { 1, undef }
  %or = or <2 x i32> %x, %shf
  %and = and <2 x i32> %or, { 1, 1 }
  %ret = icmp ne <2 x i32> %and, { 0, 0 }
  ret <2 x i1> %ret
}
=>
define <2 x i1> @icmp_and_or_lshr_cst_vec_undef_commute(<2 x i32> %xp) {
%0:
  %x = srem <2 x i32> %xp, { 42, 42 }
  %1 = and <2 x i32> %x, { 3, poison }
  %ret = icmp ne <2 x i32> %1, { 0, 0 }
  ret <2 x i1> %ret
}
Transformation seems to be correct!


----------------------------------------
define i1 @shl_ap1_zero_ap2_non_zero_2(i32 %a) {
%0:
  %shl = shl i32 4, %a
  %cmp = icmp eq i32 %shl, 0
  ret i1 %cmp
}
=>
define i1 @shl_ap1_zero_ap2_non_zero_2(i32 %a) {
%0:
  %cmp = icmp ugt i32 %a, 29
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @shl_ap1_zero_ap2_non_zero_2_vec(<2 x i32> %a) {
%0:
  %shl = shl <2 x i32> { 4, 4 }, %a
  %cmp = icmp eq <2 x i32> %shl, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @shl_ap1_zero_ap2_non_zero_2_vec(<2 x i32> %a) {
%0:
  %cmp = icmp ugt <2 x i32> %a, { 29, 29 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @shl_ap1_zero_ap2_non_zero_2_vec_nonuniform(<2 x i32> %a) {
%0:
  %shl = shl <2 x i32> { 4, 5 }, %a
  %cmp = icmp eq <2 x i32> %shl, { 0, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @shl_ap1_zero_ap2_non_zero_2_vec_nonuniform(<2 x i32> %a) {
%0:
  %shl = shl <2 x i32> { 4, 5 }, %a
  %cmp = icmp eq <2 x i32> %shl, { 0, 0 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @shl_ap1_zero_ap2_non_zero_4(i32 %a) {
%0:
  %shl = shl i32 4294967294, %a
  %cmp = icmp eq i32 %shl, 0
  ret i1 %cmp
}
=>
define i1 @shl_ap1_zero_ap2_non_zero_4(i32 %a) {
%0:
  %cmp = icmp ugt i32 %a, 30
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @shl_ap1_non_zero_ap2_non_zero_both_positive(i32 %a) {
%0:
  %shl = shl i32 50, %a
  %cmp = icmp eq i32 %shl, 50
  ret i1 %cmp
}
=>
define i1 @shl_ap1_non_zero_ap2_non_zero_both_positive(i32 %a) {
%0:
  %cmp = icmp eq i32 %a, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @shl_ap1_non_zero_ap2_non_zero_both_negative(i32 %a) {
%0:
  %shl = shl i32 4294967246, %a
  %cmp = icmp eq i32 %shl, 4294967246
  ret i1 %cmp
}
=>
define i1 @shl_ap1_non_zero_ap2_non_zero_both_negative(i32 %a) {
%0:
  %cmp = icmp eq i32 %a, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @shl_ap1_non_zero_ap2_non_zero_ap1_1(i32 %a) {
%0:
  %shl = shl i32 50, %a
  %cmp = icmp eq i32 %shl, 25
  ret i1 %cmp
}
=>
define i1 @shl_ap1_non_zero_ap2_non_zero_ap1_1(i32 %a) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @shl_ap1_non_zero_ap2_non_zero_ap1_2(i32 %a) {
%0:
  %shl = shl i32 25, %a
  %cmp = icmp eq i32 %shl, 50
  ret i1 %cmp
}
=>
define i1 @shl_ap1_non_zero_ap2_non_zero_ap1_2(i32 %a) {
%0:
  %cmp = icmp eq i32 %a, 1
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @shl_ap1_non_zero_ap2_non_zero_ap1_3(i32 %a) {
%0:
  %shl = shl i32 26, %a
  %cmp = icmp eq i32 %shl, 50
  ret i1 %cmp
}
=>
define i1 @shl_ap1_non_zero_ap2_non_zero_ap1_3(i32 %a) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sgt_zero_add_nsw(i32 %a) {
%0:
  %add = add nsw i32 %a, 1
  %cmp = icmp sgt i32 %add, 0
  ret i1 %cmp
}
=>
define i1 @icmp_sgt_zero_add_nsw(i32 %a) {
%0:
  %cmp = icmp sgt i32 %a, 4294967295
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sge_zero_add_nsw(i32 %a) {
%0:
  %add = add nsw i32 %a, 1
  %cmp = icmp sge i32 %add, 0
  ret i1 %cmp
}
=>
define i1 @icmp_sge_zero_add_nsw(i32 %a) {
%0:
  %cmp = icmp sgt i32 %a, 4294967294
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @icmp_sle_zero_add_nsw(i32 %a) {
%0:
  %add = add nsw i32 %a, 1
  %cmp = icmp sle i32 %add, 0
  ret i1 %cmp
}
=>
define i1 @icmp_sle_zero_add_nsw(i32 %a) {
%0:
  %cmp = icmp slt i32 %a, 0
  ret i1 %cmp
}
Transformation seems to be correct!

ERROR: Unsupported instruction:   %xchg = cmpxchg i32* %sc, i32 %old_val, i32 %new_val seq_cst seq_cst

----------------------------------------
define i1 @f1(i64 %a, i64 %b) {
%0:
  %t = sub nsw i64 %a, %b
  %v = icmp sge i64 %t, 0
  ret i1 %v
}
=>
define i1 @f1(i64 %a, i64 %b) {
%0:
  %v = icmp sge i64 %a, %b
  ret i1 %v
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i1> @f1_vec(<2 x i64> %a, <2 x i64> %b) {
%0:
  %t = sub nsw <2 x i64> %a, %b
  %v = icmp sgt <2 x i64> %t, { -1, -1 }
  ret <2 x i1> %v
}
=>
define <2 x i1> @f1_vec(<2 x i64> %a, <2 x i64> %b) {
%0:
  %v = icmp sge <2 x i64> %a, %b
  ret <2 x i1> %v
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @f2(i64 %a, i64 %b) {
%0:
  %t = sub nsw i64 %a, %b
  %v = icmp sgt i64 %t, 0
  ret i1 %v
}
=>
define i1 @f2(i64 %a, i64 %b) {
%0:
  %v = icmp sgt i64 %a, %b
  ret i1 %v
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @f2_vec(<2 x i64> %a, <2 x i64> %b) {
%0:
  %t = sub nsw <2 x i64> %a, %b
  %v = icmp sgt <2 x i64> %t, { 0, 0 }
  ret <2 x i1> %v
}
=>
define <2 x i1> @f2_vec(<2 x i64> %a, <2 x i64> %b) {
%0:
  %v = icmp sgt <2 x i64> %a, %b
  ret <2 x i1> %v
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @f3(i64 %a, i64 %b) {
%0:
  %t = sub nsw i64 %a, %b
  %v = icmp slt i64 %t, 0
  ret i1 %v
}
=>
define i1 @f3(i64 %a, i64 %b) {
%0:
  %v = icmp slt i64 %a, %b
  ret i1 %v
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i1> @f3_vec(<2 x i64> %a, <2 x i64> %b) {
%0:
  %t = sub nsw <2 x i64> %a, %b
  %v = icmp slt <2 x i64> %t, { 0, 0 }
  ret <2 x i1> %v
}
=>
define <2 x i1> @f3_vec(<2 x i64> %a, <2 x i64> %b) {
%0:
  %v = icmp slt <2 x i64> %a, %b
  ret <2 x i1> %v
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @f4(i64 %a, i64 %b) {
%0:
  %t = sub nsw i64 %a, %b
  %v = icmp sle i64 %t, 0
  ret i1 %v
}
=>
define i1 @f4(i64 %a, i64 %b) {
%0:
  %v = icmp sle i64 %a, %b
  ret i1 %v
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @f4_vec(<2 x i64> %a, <2 x i64> %b) {
%0:
  %t = sub nsw <2 x i64> %a, %b
  %v = icmp slt <2 x i64> %t, { 1, 1 }
  ret <2 x i1> %v
}
=>
define <2 x i1> @f4_vec(<2 x i64> %a, <2 x i64> %b) {
%0:
  %v = icmp sle <2 x i64> %a, %b
  ret <2 x i1> %v
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @f5(i8 %a, i8 %b) {
%0:
  %conv = zext i8 %a to i32
  %conv3 = zext i8 %b to i32
  %sub = sub nsw i32 %conv, %conv3
  %cmp4 = icmp slt i32 %sub, 0
  %sub7 = sub nsw i32 0, %sub
  %sub7.sub = select i1 %cmp4, i32 %sub7, i32 %sub
  ret i32 %sub7.sub
}
=>
define i32 @f5(i8 %a, i8 %b) {
%0:
  %conv = zext i8 %a to i32
  %conv3 = zext i8 %b to i32
  %sub = sub nsw i32 %conv, %conv3
  %1 = abs i32 %sub, 1
  ret i32 %1
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @f6(i32 %a, i32 %b) {
%0:
  %sext = shl i32 %a, 24
  %conv = ashr i32 %sext, 24
  %sext6 = shl i32 %b, 24
  %conv4 = ashr i32 %sext6, 24
  %cmp = icmp eq i32 %conv, %conv4
  %s = select i1 %cmp, i32 10000, i32 0
  ret i32 %s
}
=>
define i32 @f6(i32 %a, i32 %b) {
%0:
  %cmp.unshifted = xor i32 %a, %b
  %cmp.mask = and i32 %cmp.unshifted, 255
  %cmp = icmp eq i32 %cmp.mask, 0
  %s = select i1 %cmp, i32 10000, i32 0
  ret i32 %s
}
Transformation seems to be correct!


----------------------------------------
define i32 @f7(i32 %a, i32 %b) {
%0:
  %sext = shl i32 %a, 23
  %sext6 = shl i32 %b, 23
  %cmp = icmp ne i32 %sext, %sext6
  %s = select i1 %cmp, i32 10000, i32 0
  ret i32 %s
}
=>
define i32 @f7(i32 %a, i32 %b) {
%0:
  %cmp.not.unshifted = xor i32 %a, %b
  %cmp.not.mask = and i32 %cmp.not.unshifted, 511
  %cmp.not = icmp eq i32 %cmp.not.mask, 0
  %s = select i1 %cmp.not, i32 0, i32 10000
  ret i32 %s
}
Transformation seems to be correct!


----------------------------------------
define i1 @f8(i32 %val, i32 %lim) {
%0:
  %lim.sub = add i32 %lim, 4294967295
  %val.and = and i32 %val, %lim.sub
  %r = icmp ult i32 %val.and, %lim
  ret i1 %r
}
=>
define i1 @f8(i32 %val, i32 %lim) {
%0:
  %r = icmp ne i32 %lim, 0
  ret i1 %r
}
Transformation seems to be correct!


----------------------------------------
define i1 @f9(i32 %val, i32 %lim) {
%0:
  %lim.sub = sub i32 %lim, 1
  %val.and = and i32 %val, %lim.sub
  %r = icmp ult i32 %val.and, %lim
  ret i1 %r
}
=>
define i1 @f9(i32 %val, i32 %lim) {
%0:
  %r = icmp ne i32 %lim, 0
  ret i1 %r
}
Transformation seems to be correct!

ERROR: Unsupported instruction:   %__constexpr_2 = ptrtoint i1 (i16)* @f10 to i8
ERROR: Unsupported instruction:   %__constexpr_1 = zext i8 ptrtoint (i1 (i16)* @f10 to i8) to i16
ERROR: Unsupported instruction:   %__constexpr_4 = ptrtoint i1 (i16)* @f10 to i8
ERROR: Unsupported instruction:   %__constexpr_3 = zext i8 ptrtoint (i1 (i16)* @f10 to i8) to i16
ERROR: Unsupported instruction:   %__constexpr_0 = mul i16 zext (i8 ptrtoint (i1 (i16)* @f10 to i8) to i16), zext (i8 ptrtoint (i1 (i16)* @f10 to i8) to i16)
ERROR: Unsupported instruction:   %cmp580 = icmp uge i16 %p, mul (i16 zext (i8 ptrtoint (i1 (i16)* @f10 to i8) to i16), i16 zext (i8 ptrtoint (i1 (i16)* @f10 to i8) to i16))

----------------------------------------
define i1 @cmp_sgt_rhs_dec(float %x, i32 %i) {
%0:
  %conv = fptosi float %x to i32
  %dec = sub nsw i32 %i, 1
  %cmp = icmp sgt i32 %conv, %dec
  ret i1 %cmp
}
=>
define i1 @cmp_sgt_rhs_dec(float %x, i32 %i) {
%0:
  %conv = fptosi float %x to i32
  %cmp = icmp sge i32 %conv, %i
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @cmp_sle_rhs_dec(float %x, i32 %i) {
%0:
  %conv = fptosi float %x to i32
  %dec = sub nsw i32 %i, 1
  %cmp = icmp sle i32 %conv, %dec
  ret i1 %cmp
}
=>
define i1 @cmp_sle_rhs_dec(float %x, i32 %i) {
%0:
  %conv = fptosi float %x to i32
  %cmp = icmp slt i32 %conv, %i
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @cmp_sge_rhs_inc(float %x, i32 %i) {
%0:
  %conv = fptosi float %x to i32
  %inc = add nsw i32 %i, 1
  %cmp = icmp sge i32 %conv, %inc
  ret i1 %cmp
}
=>
define i1 @cmp_sge_rhs_inc(float %x, i32 %i) {
%0:
  %conv = fptosi float %x to i32
  %cmp = icmp sgt i32 %conv, %i
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @cmp_slt_rhs_inc(float %x, i32 %i) {
%0:
  %conv = fptosi float %x to i32
  %inc = add nsw i32 %i, 1
  %cmp = icmp slt i32 %conv, %inc
  ret i1 %cmp
}
=>
define i1 @cmp_slt_rhs_inc(float %x, i32 %i) {
%0:
  %conv = fptosi float %x to i32
  %cmp = icmp sle i32 %conv, %i
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @PR26407(i32 %x, i32 %y) {
%0:
  %addx = add i32 %x, 2147483647
  %addy = add i32 %y, 2147483647
  %cmp = icmp uge i32 %addx, %addy
  ret i1 %cmp
}
=>
define i1 @PR26407(i32 %x, i32 %y) {
%0:
  %addx = add i32 %x, 2147483647
  %addy = add i32 %y, 2147483647
  %cmp = icmp uge i32 %addx, %addy
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @cmp_inverse_mask_bits_set_eq(i32 %x) {
%0:
  %or = or i32 %x, 42
  %cmp = icmp eq i32 %or, 4294967295
  ret i1 %cmp
}
=>
define i1 @cmp_inverse_mask_bits_set_eq(i32 %x) {
%0:
  %1 = and i32 %x, 4294967253
  %cmp = icmp eq i32 %1, 4294967253
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @cmp_inverse_mask_bits_set_eq_vec(<2 x i32> %x) {
%0:
  %or = or <2 x i32> %x, { 42, 42 }
  %cmp = icmp eq <2 x i32> %or, { 4294967295, 4294967295 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @cmp_inverse_mask_bits_set_eq_vec(<2 x i32> %x) {
%0:
  %1 = and <2 x i32> %x, { 4294967253, 4294967253 }
  %cmp = icmp eq <2 x i32> %1, { 4294967253, 4294967253 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @cmp_inverse_mask_bits_set_ne(i32 %x) {
%0:
  %or = or i32 %x, 42
  %cmp = icmp ne i32 %or, 4294967295
  ret i1 %cmp
}
=>
define i1 @cmp_inverse_mask_bits_set_ne(i32 %x) {
%0:
  %1 = and i32 %x, 4294967253
  %cmp = icmp ne i32 %1, 4294967253
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @PR27792(i128 %a) {
%0:
  %cmp = icmp sge i128 %a, 0
  ret i1 %cmp
}
=>
define i1 @PR27792(i128 %a) {
%0:
  %cmp = icmp sgt i128 %a, 340282366920938463463374607431768211455
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @PR27792_2(i128 %a) {
%0:
  %b = icmp uge i128 %a, 1
  ret i1 %b
}
=>
define i1 @PR27792_2(i128 %a) {
%0:
  %b = icmp ne i128 %a, 0
  ret i1 %b
}
Transformation seems to be correct!


----------------------------------------
define i1 @ugtMaxSignedVal(i8 %a) {
%0:
  %cmp = icmp ugt i8 %a, 127
  ret i1 %cmp
}
=>
define i1 @ugtMaxSignedVal(i8 %a) {
%0:
  %cmp = icmp slt i8 %a, 0
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @ugtMaxSignedValVec(<2 x i8> %a) {
%0:
  %cmp = icmp ugt <2 x i8> %a, { 127, 127 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @ugtMaxSignedValVec(<2 x i8> %a) {
%0:
  %cmp = icmp slt <2 x i8> %a, { 0, 0 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @ugtKnownBits(i8 %a) {
%0:
  %b = and i8 %a, 17
  %cmp = icmp ugt i8 %b, 16
  ret i1 %cmp
}
=>
define i1 @ugtKnownBits(i8 %a) {
%0:
  %b = and i8 %a, 17
  %cmp = icmp eq i8 %b, 17
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @ugtKnownBitsVec(<2 x i8> %a) {
%0:
  %b = and <2 x i8> %a, { 17, 17 }
  %cmp = icmp ugt <2 x i8> %b, { 16, 16 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @ugtKnownBitsVec(<2 x i8> %a) {
%0:
  %b = and <2 x i8> %a, { 17, 17 }
  %cmp = icmp eq <2 x i8> %b, { 17, 17 }
  ret <2 x i1> %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @or_ptrtoint_mismatch(* %p, * %q) {
%0:
  %pp = ptrtoint * %p to i64
  %qq = ptrtoint * %q to i64
  %o = or i64 %pp, %qq
  %b = icmp eq i64 %o, 0
  ret i1 %b
}
=>
define i1 @or_ptrtoint_mismatch(* %p, * %q) {
%0:
  %1 = icmp eq * %p, null
  %2 = icmp eq * %q, null
  %b = and i1 %1, %2
  ret i1 %b
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:
* %p = null
* %q = pointer(non-local, block_id=2, offset=-9223372034841509824)

Source:
i64 %pp = #x0000000000000000 (0)
i64 %qq = #x0000000000000000 (0)
i64 %o = #x0000000000000000 (0)
i1 %b = #x1 (1)

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	address: 0
Block 1 >	size: 2075555349469350945	align: 2	alloc type: 0	address: 5404460392340521056
Block 2 >	size: 288964612	align: 0	alloc type: 0	address: 9223372034841509824

Target:
i1 %1 = #x1 (1)
i1 %2 = #x0 (0)
i1 %b = #x0 (0)
Source value: #x1 (1)
Target value: #x0 (0)


------------------- SMT STATS -------------------
Num queries: 890
Num invalid: 0
Num skips:   0
Num trivial: 953 (51.7%)
Num timeout: 26 (2.9%)
Num errors:  0 (0.0%)
Num SAT:     272 (30.6%)
Num UNSAT:   592 (66.5%)

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/build/opt-alive.sh -instcombine -S
+ /home/nlopes/llvm/build/bin/FileCheck --allow-unused-prefixes=false /home/nlopes/llvm/llvm/test/Transforms/InstCombine/icmp.ll

Alive2: Transform doesn't verify; aborting!
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck --allow-unused-prefixes=false /home/nlopes/llvm/llvm/test/Transforms/InstCombine/icmp.ll

 

<-- Back