Test Failure: Transforms/InstSimplify/select.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define i1 @bool_true_or_false(i1 %cond) {
%0:
  %s = select i1 %cond, i1 1, i1 0
  ret i1 %s
}
=>
define i1 @bool_true_or_false(i1 %cond) {
%0:
  ret i1 %cond
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @bool_true_or_false_vec(<2 x i1> %cond) {
%0:
  %s = select <2 x i1> %cond, <2 x i1> { 1, 1 }, <2 x i1> { 0, 0 }
  ret <2 x i1> %s
}
=>
define <2 x i1> @bool_true_or_false_vec(<2 x i1> %cond) {
%0:
  ret <2 x i1> %cond
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @bool_true_or_false_vec_undef(<2 x i1> %cond) {
%0:
  %s = select <2 x i1> %cond, <2 x i1> { undef, 1 }, <2 x i1> { 0, undef }
  ret <2 x i1> %s
}
=>
define <2 x i1> @bool_true_or_false_vec_undef(<2 x i1> %cond) {
%0:
  ret <2 x i1> %cond
}
Transformation seems to be correct!


----------------------------------------
define i32 @cond_is_false(i32 %A, i32 %B) {
%0:
  %C = select i1 0, i32 %A, i32 %B
  ret i32 %C
}
=>
define i32 @cond_is_false(i32 %A, i32 %B) {
%0:
  ret i32 %B
}
Transformation seems to be correct!


----------------------------------------
define i32 @cond_is_true(i32 %A, i32 %B) {
%0:
  %C = select i1 1, i32 %A, i32 %B
  ret i32 %C
}
=>
define i32 @cond_is_true(i32 %A, i32 %B) {
%0:
  ret i32 %A
}
Transformation seems to be correct!


----------------------------------------
define i32 @equal_arms(i1 %cond, i32 %x) {
%0:
  %V = select i1 %cond, i32 %x, i32 %x
  ret i32 %V
}
=>
define i32 @equal_arms(i1 %cond, i32 %x) {
%0:
  ret i32 %x
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @equal_arms_vec(<2 x i1> %cond, <2 x i32> %x) {
%0:
  %V = select <2 x i1> %cond, <2 x i32> %x, <2 x i32> %x
  ret <2 x i32> %V
}
=>
define <2 x i32> @equal_arms_vec(<2 x i1> %cond, <2 x i32> %x) {
%0:
  ret <2 x i32> %x
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @equal_arms_vec_undef(<2 x i1> %cond) {
%0:
  %V = select <2 x i1> %cond, <2 x i32> { 42, undef }, <2 x i32> { undef, 42 }
  ret <2 x i32> %V
}
=>
define <2 x i32> @equal_arms_vec_undef(<2 x i1> %cond) {
%0:
  ret <2 x i32> { 42, 42 }
}
Transformation seems to be correct!


----------------------------------------
define <3 x float> @equal_arms_vec_less_undef(<3 x i1> %cond) {
%0:
  %V = select <3 x i1> %cond, <3 x float> { 42.000000, undef, 43.000000 }, <3 x float> { 42.000000, 42.000000, 43.000000 }
  ret <3 x float> %V
}
=>
define <3 x float> @equal_arms_vec_less_undef(<3 x i1> %cond) {
%0:
  ret <3 x float> { 42.000000, 42.000000, 43.000000 }
}
Transformation seems to be correct!


----------------------------------------
define <3 x float> @equal_arms_vec_more_undef(<3 x i1> %cond) {
%0:
  %V = select <3 x i1> %cond, <3 x float> { 42.000000, undef, undef }, <3 x float> { undef, undef, 43.000000 }
  ret <3 x float> %V
}
=>
define <3 x float> @equal_arms_vec_more_undef(<3 x i1> %cond) {
%0:
  ret <3 x float> { 42.000000, undef, 43.000000 }
}
Transformation seems to be correct!


----------------------------------------
define <2 x i8> @vsel_tvec(<2 x i8> %x, <2 x i8> %y) {
%0:
  %s = select <2 x i1> { 1, 1 }, <2 x i8> %x, <2 x i8> %y
  ret <2 x i8> %s
}
=>
define <2 x i8> @vsel_tvec(<2 x i8> %x, <2 x i8> %y) {
%0:
  ret <2 x i8> %x
}
Transformation seems to be correct!


----------------------------------------
define <2 x i8> @vsel_fvec(<2 x i8> %x, <2 x i8> %y) {
%0:
  %s = select <2 x i1> { 0, 0 }, <2 x i8> %x, <2 x i8> %y
  ret <2 x i8> %s
}
=>
define <2 x i8> @vsel_fvec(<2 x i8> %x, <2 x i8> %y) {
%0:
  ret <2 x i8> %y
}
Transformation seems to be correct!


----------------------------------------
define <2 x i8> @vsel_mixedvec() {
%0:
  %s = select <2 x i1> { 1, 0 }, <2 x i8> { 0, 1 }, <2 x i8> { 2, 3 }
  ret <2 x i8> %s
}
=>
define <2 x i8> @vsel_mixedvec() {
%0:
  ret <2 x i8> { 0, 3 }
}
Transformation seems to be correct!


----------------------------------------
define <3 x i8> @vsel_undef_true_op(<3 x i8> %x, <3 x i8> %y) {
%0:
  %s = select <3 x i1> { 1, undef, 1 }, <3 x i8> %x, <3 x i8> %y
  ret <3 x i8> %s
}
=>
define <3 x i8> @vsel_undef_true_op(<3 x i8> %x, <3 x i8> %y) {
%0:
  %s = select <3 x i1> { 1, undef, 1 }, <3 x i8> %x, <3 x i8> %y
  ret <3 x i8> %s
}
Transformation seems to be correct!


----------------------------------------
define <3 x i4> @vsel_undef_false_op(<3 x i4> %x, <3 x i4> %y) {
%0:
  %s = select <3 x i1> { 0, undef, undef }, <3 x i4> %x, <3 x i4> %y
  ret <3 x i4> %s
}
=>
define <3 x i4> @vsel_undef_false_op(<3 x i4> %x, <3 x i4> %y) {
%0:
  %s = select <3 x i1> { 0, undef, undef }, <3 x i4> %x, <3 x i4> %y
  ret <3 x i4> %s
}
Transformation seems to be correct!


----------------------------------------
define i32 @test1(i32 %x) {
%0:
  %and = and i32 %x, 1
  %cmp = icmp eq i32 %and, 0
  %and1 = and i32 %x, 4294967294
  %and1.x = select i1 %cmp, i32 %and1, i32 %x
  ret i32 %and1.x
}
=>
define i32 @test1(i32 %x) {
%0:
  ret i32 %x
}
Transformation seems to be correct!


----------------------------------------
define i32 @test2(i32 %x) {
%0:
  %and = and i32 %x, 1
  %cmp = icmp ne i32 %and, 0
  %and1 = and i32 %x, 4294967294
  %and1.x = select i1 %cmp, i32 %x, i32 %and1
  ret i32 %and1.x
}
=>
define i32 @test2(i32 %x) {
%0:
  ret i32 %x
}
Transformation seems to be correct!


----------------------------------------
define i32 @test3(i32 %x) {
%0:
  %and = and i32 %x, 1
  %cmp = icmp ne i32 %and, 0
  %and1 = and i32 %x, 4294967294
  %and1.x = select i1 %cmp, i32 %and1, i32 %x
  ret i32 %and1.x
}
=>
define i32 @test3(i32 %x) {
%0:
  %and1 = and i32 %x, 4294967294
  ret i32 %and1
}
Transformation seems to be correct!


----------------------------------------
define i32 @test4(i32 %X) {
%0:
  %cmp = icmp slt i32 %X, 0
  %or = or i32 %X, 2147483648
  %cond = select i1 %cmp, i32 %X, i32 %or
  ret i32 %cond
}
=>
define i32 @test4(i32 %X) {
%0:
  %or = or i32 %X, 2147483648
  ret i32 %or
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test4noncanon(i32 %X) {
%0:
  %cmp = icmp sle i32 %X, 4294967295
  %or = or i32 %X, 2147483648
  %cond = select i1 %cmp, i32 %X, i32 %or
  ret i32 %cond
}
=>
define i32 @test4noncanon(i32 %X) {
%0:
  %or = or i32 %X, 2147483648
  ret i32 %or
}
Transformation seems to be correct!


----------------------------------------
define i32 @test5(i32 %X) {
%0:
  %cmp = icmp slt i32 %X, 0
  %or = or i32 %X, 2147483648
  %cond = select i1 %cmp, i32 %or, i32 %X
  ret i32 %cond
}
=>
define i32 @test5(i32 %X) {
%0:
  ret i32 %X
}
Transformation seems to be correct!


----------------------------------------
define i32 @test6(i32 %X) {
%0:
  %cmp = icmp slt i32 %X, 0
  %and = and i32 %X, 2147483647
  %cond = select i1 %cmp, i32 %and, i32 %X
  ret i32 %cond
}
=>
define i32 @test6(i32 %X) {
%0:
  %and = and i32 %X, 2147483647
  ret i32 %and
}
Transformation seems to be correct!


----------------------------------------
define i32 @test7(i32 %X) {
%0:
  %cmp = icmp slt i32 %X, 0
  %and = and i32 %X, 2147483647
  %cond = select i1 %cmp, i32 %X, i32 %and
  ret i32 %cond
}
=>
define i32 @test7(i32 %X) {
%0:
  ret i32 %X
}
Transformation seems to be correct!


----------------------------------------
define i32 @test8(i32 %X) {
%0:
  %cmp = icmp sgt i32 %X, 4294967295
  %or = or i32 %X, 2147483648
  %cond = select i1 %cmp, i32 %X, i32 %or
  ret i32 %cond
}
=>
define i32 @test8(i32 %X) {
%0:
  ret i32 %X
}
Transformation seems to be correct!


----------------------------------------
define i32 @test9(i32 %X) {
%0:
  %cmp = icmp sgt i32 %X, 4294967295
  %or = or i32 %X, 2147483648
  %cond = select i1 %cmp, i32 %or, i32 %X
  ret i32 %cond
}
=>
define i32 @test9(i32 %X) {
%0:
  %or = or i32 %X, 2147483648
  ret i32 %or
}
Transformation seems to be correct!


----------------------------------------
define i32 @test9noncanon(i32 %X) {
%0:
  %cmp = icmp sge i32 %X, 0
  %or = or i32 %X, 2147483648
  %cond = select i1 %cmp, i32 %or, i32 %X
  ret i32 %cond
}
=>
define i32 @test9noncanon(i32 %X) {
%0:
  %or = or i32 %X, 2147483648
  ret i32 %or
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test10(i32 %X) {
%0:
  %cmp = icmp sgt i32 %X, 4294967295
  %and = and i32 %X, 2147483647
  %cond = select i1 %cmp, i32 %and, i32 %X
  ret i32 %cond
}
=>
define i32 @test10(i32 %X) {
%0:
  ret i32 %X
}
Transformation seems to be correct!


----------------------------------------
define i32 @test11(i32 %X) {
%0:
  %cmp = icmp sgt i32 %X, 4294967295
  %and = and i32 %X, 2147483647
  %cond = select i1 %cmp, i32 %X, i32 %and
  ret i32 %cond
}
=>
define i32 @test11(i32 %X) {
%0:
  %and = and i32 %X, 2147483647
  ret i32 %and
}
Transformation seems to be correct!


----------------------------------------
define <2 x i8> @test11vec(<2 x i8> %X) {
%0:
  %cmp = icmp sgt <2 x i8> %X, { 255, 255 }
  %and = and <2 x i8> %X, { 127, 127 }
  %sel = select <2 x i1> %cmp, <2 x i8> %X, <2 x i8> %and
  ret <2 x i8> %sel
}
=>
define <2 x i8> @test11vec(<2 x i8> %X) {
%0:
  %and = and <2 x i8> %X, { 127, 127 }
  ret <2 x i8> %and
}
Transformation seems to be correct!


----------------------------------------
define i32 @test12(i32 %X) {
%0:
  %cmp = icmp ult i32 %X, 4
  %and = and i32 %X, 3
  %cond = select i1 %cmp, i32 %X, i32 %and
  ret i32 %cond
}
=>
define i32 @test12(i32 %X) {
%0:
  %and = and i32 %X, 3
  ret i32 %and
}
Transformation seems to be correct!


----------------------------------------
define i32 @test12noncanon(i32 %X) {
%0:
  %cmp = icmp ule i32 %X, 3
  %and = and i32 %X, 3
  %cond = select i1 %cmp, i32 %X, i32 %and
  ret i32 %cond
}
=>
define i32 @test12noncanon(i32 %X) {
%0:
  %and = and i32 %X, 3
  ret i32 %and
}
Transformation seems to be correct!


----------------------------------------
define i32 @test13(i32 %X) {
%0:
  %cmp = icmp ugt i32 %X, 3
  %and = and i32 %X, 3
  %cond = select i1 %cmp, i32 %and, i32 %X
  ret i32 %cond
}
=>
define i32 @test13(i32 %X) {
%0:
  %and = and i32 %X, 3
  ret i32 %and
}
Transformation seems to be correct!


----------------------------------------
define i32 @test13noncanon(i32 %X) {
%0:
  %cmp = icmp uge i32 %X, 4
  %and = and i32 %X, 3
  %cond = select i1 %cmp, i32 %and, i32 %X
  ret i32 %cond
}
=>
define i32 @test13noncanon(i32 %X) {
%0:
  %and = and i32 %X, 3
  ret i32 %and
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_and_8_eq_0_or_8(i32 %x) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp eq i32 %and, 0
  %or = or i32 %x, 8
  %sel = select i1 %cmp, i32 %or, i32 %x
  ret i32 %sel
}
=>
define i32 @select_icmp_and_8_eq_0_or_8(i32 %x) {
%0:
  %or = or i32 %x, 8
  ret i32 %or
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_and_8_eq_0_or_8_alt(i32 %x) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp ne i32 %and, 0
  %or = or i32 %x, 8
  %sel = select i1 %cmp, i32 %x, i32 %or
  ret i32 %sel
}
=>
define i32 @select_icmp_and_8_eq_0_or_8_alt(i32 %x) {
%0:
  %or = or i32 %x, 8
  ret i32 %or
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_and_8_ne_0_or_8(i32 %x) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp ne i32 %and, 0
  %or = or i32 %x, 8
  %sel = select i1 %cmp, i32 %or, i32 %x
  ret i32 %sel
}
=>
define i32 @select_icmp_and_8_ne_0_or_8(i32 %x) {
%0:
  ret i32 %x
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_and_8_ne_0_or_8_alt(i32 %x) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp eq i32 %and, 0
  %or = or i32 %x, 8
  %sel = select i1 %cmp, i32 %x, i32 %or
  ret i32 %sel
}
=>
define i32 @select_icmp_and_8_ne_0_or_8_alt(i32 %x) {
%0:
  ret i32 %x
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_and_8_eq_0_and_not_8(i32 %x) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp eq i32 %and, 0
  %and1 = and i32 %x, 4294967287
  %sel = select i1 %cmp, i32 %x, i32 %and1
  ret i32 %sel
}
=>
define i32 @select_icmp_and_8_eq_0_and_not_8(i32 %x) {
%0:
  %and1 = and i32 %x, 4294967287
  ret i32 %and1
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_and_8_eq_0_and_not_8_alt(i32 %x) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp ne i32 %and, 0
  %and1 = and i32 %x, 4294967287
  %sel = select i1 %cmp, i32 %and1, i32 %x
  ret i32 %sel
}
=>
define i32 @select_icmp_and_8_eq_0_and_not_8_alt(i32 %x) {
%0:
  %and1 = and i32 %x, 4294967287
  ret i32 %and1
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_and_8_ne_0_and_not_8(i32 %x) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp ne i32 %and, 0
  %and1 = and i32 %x, 4294967287
  %sel = select i1 %cmp, i32 %x, i32 %and1
  ret i32 %sel
}
=>
define i32 @select_icmp_and_8_ne_0_and_not_8(i32 %x) {
%0:
  ret i32 %x
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_and_8_ne_0_and_not_8_alt(i32 %x) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp eq i32 %and, 0
  %and1 = and i32 %x, 4294967287
  %sel = select i1 %cmp, i32 %and1, i32 %x
  ret i32 %sel
}
=>
define i32 @select_icmp_and_8_ne_0_and_not_8_alt(i32 %x) {
%0:
  ret i32 %x
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_trunc_8_ne_0_or_128(i32 %x) {
%0:
  %trunc = trunc i32 %x to i8
  %cmp = icmp sgt i8 %trunc, 255
  %or = or i32 %x, 128
  %sel = select i1 %cmp, i32 %or, i32 %x
  ret i32 %sel
}
=>
define i32 @select_icmp_trunc_8_ne_0_or_128(i32 %x) {
%0:
  %or = or i32 %x, 128
  ret i32 %or
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_trunc_8_ne_0_or_128_alt(i32 %x) {
%0:
  %trunc = trunc i32 %x to i8
  %cmp = icmp slt i8 %trunc, 0
  %or = or i32 %x, 128
  %sel = select i1 %cmp, i32 %x, i32 %or
  ret i32 %sel
}
=>
define i32 @select_icmp_trunc_8_ne_0_or_128_alt(i32 %x) {
%0:
  %or = or i32 %x, 128
  ret i32 %or
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_trunc_8_eq_0_or_128(i32 %x) {
%0:
  %trunc = trunc i32 %x to i8
  %cmp = icmp slt i8 %trunc, 0
  %or = or i32 %x, 128
  %sel = select i1 %cmp, i32 %or, i32 %x
  ret i32 %sel
}
=>
define i32 @select_icmp_trunc_8_eq_0_or_128(i32 %x) {
%0:
  ret i32 %x
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_trunc_8_eq_0_or_128_alt(i32 %x) {
%0:
  %trunc = trunc i32 %x to i8
  %cmp = icmp sgt i8 %trunc, 255
  %or = or i32 %x, 128
  %sel = select i1 %cmp, i32 %x, i32 %or
  ret i32 %sel
}
=>
define i32 @select_icmp_trunc_8_eq_0_or_128_alt(i32 %x) {
%0:
  ret i32 %x
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_trunc_8_eq_0_and_not_8(i32 %x) {
%0:
  %trunc = trunc i32 %x to i4
  %cmp = icmp sgt i4 %trunc, 15
  %and = and i32 %x, 4294967287
  %sel = select i1 %cmp, i32 %x, i32 %and
  ret i32 %sel
}
=>
define i32 @select_icmp_trunc_8_eq_0_and_not_8(i32 %x) {
%0:
  %and = and i32 %x, 4294967287
  ret i32 %and
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_trunc_8_eq_0_and_not_8_alt(i32 %x) {
%0:
  %trunc = trunc i32 %x to i4
  %cmp = icmp slt i4 %trunc, 0
  %and = and i32 %x, 4294967287
  %sel = select i1 %cmp, i32 %and, i32 %x
  ret i32 %sel
}
=>
define i32 @select_icmp_trunc_8_eq_0_and_not_8_alt(i32 %x) {
%0:
  %and = and i32 %x, 4294967287
  ret i32 %and
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_trunc_8_ne_0_and_not_8(i32 %x) {
%0:
  %trunc = trunc i32 %x to i4
  %cmp = icmp slt i4 %trunc, 0
  %and = and i32 %x, 4294967287
  %sel = select i1 %cmp, i32 %x, i32 %and
  ret i32 %sel
}
=>
define i32 @select_icmp_trunc_8_ne_0_and_not_8(i32 %x) {
%0:
  ret i32 %x
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_trunc_8_ne_0_and_not_8_alt(i32 %x) {
%0:
  %trunc = trunc i32 %x to i4
  %cmp = icmp sgt i4 %trunc, 15
  %and = and i32 %x, 4294967287
  %sel = select i1 %cmp, i32 %and, i32 %x
  ret i32 %sel
}
=>
define i32 @select_icmp_trunc_8_ne_0_and_not_8_alt(i32 %x) {
%0:
  ret i32 %x
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @select_icmp_and_8_ne_0_and_not_8_vec(<2 x i32> %x) {
%0:
  %and = and <2 x i32> %x, { 8, 8 }
  %cmp = icmp ne <2 x i32> %and, { 0, 0 }
  %and1 = and <2 x i32> %x, { 4294967287, 4294967287 }
  %sel = select <2 x i1> %cmp, <2 x i32> %x, <2 x i32> %and1
  ret <2 x i32> %sel
}
=>
define <2 x i32> @select_icmp_and_8_ne_0_and_not_8_vec(<2 x i32> %x) {
%0:
  ret <2 x i32> %x
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @select_icmp_trunc_8_ne_0_and_not_8_alt_vec(<2 x i32> %x) {
%0:
  %trunc = trunc <2 x i32> %x to <2 x i4>
  %cmp = icmp sgt <2 x i4> %trunc, { 15, 15 }
  %and = and <2 x i32> %x, { 4294967287, 4294967287 }
  %sel = select <2 x i1> %cmp, <2 x i32> %and, <2 x i32> %x
  ret <2 x i32> %sel
}
=>
define <2 x i32> @select_icmp_trunc_8_ne_0_and_not_8_alt_vec(<2 x i32> %x) {
%0:
  ret <2 x i32> %x
}
Transformation seems to be correct!


----------------------------------------
define i32 @select_icmp_x_and_8_eq_0_y_and_not_8(i32 %x, i32 %y) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp eq i32 %and, 0
  %and1 = and i32 %y, 4294967287
  %y.and1 = select i1 %cmp, i32 %y, i32 %and1
  ret i32 %y.and1
}
=>
define i32 @select_icmp_x_and_8_eq_0_y_and_not_8(i32 %x, i32 %y) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp eq i32 %and, 0
  %and1 = and i32 %y, 4294967287
  %y.and1 = select i1 %cmp, i32 %y, i32 %and1
  ret i32 %y.and1
}
Transformation seems to be correct!


----------------------------------------
define i64 @select_icmp_x_and_8_eq_0_y64_and_not_8(i32 %x, i64 %y) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp eq i32 %and, 0
  %and1 = and i64 %y, -9
  %y.and1 = select i1 %cmp, i64 %y, i64 %and1
  ret i64 %y.and1
}
=>
define i64 @select_icmp_x_and_8_eq_0_y64_and_not_8(i32 %x, i64 %y) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp eq i32 %and, 0
  %and1 = and i64 %y, -9
  %y.and1 = select i1 %cmp, i64 %y, i64 %and1
  ret i64 %y.and1
}
Transformation seems to be correct!


----------------------------------------
define i64 @select_icmp_x_and_8_ne_0_y64_and_not_8(i32 %x, i64 %y) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp eq i32 %and, 0
  %and1 = and i64 %y, -9
  %and1.y = select i1 %cmp, i64 %and1, i64 %y
  ret i64 %and1.y
}
=>
define i64 @select_icmp_x_and_8_ne_0_y64_and_not_8(i32 %x, i64 %y) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp eq i32 %and, 0
  %and1 = and i64 %y, -9
  %and1.y = select i1 %cmp, i64 %and1, i64 %y
  ret i64 %and1.y
}
Transformation seems to be correct!


----------------------------------------
define * @select_icmp_pointers(* %x, * %y) {
%0:
  %cmp = icmp slt * %x, null
  %sel = select i1 %cmp, * %x, * %y
  ret * %sel
}
=>
define * @select_icmp_pointers(* %x, * %y) {
%0:
  %cmp = icmp slt * %x, null
  %sel = select i1 %cmp, * %x, * %y
  ret * %sel
}
Transformation seems to be correct!


----------------------------------------
define i8 @assume_sel_cond(i1 %cond, i8 %x, i8 %y) {
%0:
  assume i1 %cond
  %sel = select i1 %cond, i8 %x, i8 %y
  ret i8 %sel
}
=>
define i8 @assume_sel_cond(i1 %cond, i8 %x, i8 %y) {
%0:
  assume i1 %cond
  %sel = select i1 %cond, i8 %x, i8 %y
  ret i8 %sel
}
Transformation seems to be correct!


----------------------------------------
define i8 @do_not_assume_sel_cond(i1 %cond, i8 %x, i8 %y) {
%0:
  %notcond = icmp eq i1 %cond, 0
  assume i1 %notcond
  %sel = select i1 %cond, i8 %x, i8 %y
  ret i8 %sel
}
=>
define i8 @do_not_assume_sel_cond(i1 %cond, i8 %x, i8 %y) {
%0:
  %notcond = icmp eq i1 %cond, 0
  assume i1 %notcond
  %sel = select i1 %cond, i8 %x, i8 %y
  ret i8 %sel
}
Transformation seems to be correct!


----------------------------------------
define * @select_icmp_eq_0_gep_operand(* %base, i64 %n) {
%0:
  %cond = icmp eq i64 %n, 0
  %gep = gep * %base, 4 x i64 %n
  %r = select i1 %cond, * %base, * %gep
  ret * %r
}
=>
define * @select_icmp_eq_0_gep_operand(* %base, i64 %n) {
%0:
  %gep = gep * %base, 4 x i64 %n
  ret * %gep
}
Transformation seems to be correct!


----------------------------------------
define * @select_icmp_ne_0_gep_operand(* %base, i64 %n) {
%0:
  %cond = icmp ne i64 %n, 0
  %gep = gep * %base, 4 x i64 %n
  %r = select i1 %cond, * %gep, * %base
  ret * %r
}
=>
define * @select_icmp_ne_0_gep_operand(* %base, i64 %n) {
%0:
  %gep = gep * %base, 4 x i64 %n
  ret * %gep
}
Transformation seems to be correct!


----------------------------------------
define i1 @and_cmps(i32 %x) {
%0:
  %cmp1 = icmp slt i32 %x, 92
  %cmp2 = icmp slt i32 %x, 11
  %r = select i1 %cmp1, i1 %cmp2, i1 0
  ret i1 %r
}
=>
define i1 @and_cmps(i32 %x) {
%0:
  %cmp1 = icmp slt i32 %x, 92
  %cmp2 = icmp slt i32 %x, 11
  %r = select i1 %cmp1, i1 %cmp2, i1 0
  ret i1 %r
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @and_cmps_vector(<2 x i32> %x) {
%0:
  %cmp1 = icmp slt <2 x i32> %x, { 92, 92 }
  %cmp2 = icmp slt <2 x i32> %x, { 11, 11 }
  %r = select <2 x i1> %cmp1, <2 x i1> %cmp2, <2 x i1> { 0, 0 }
  ret <2 x i1> %r
}
=>
define <2 x i1> @and_cmps_vector(<2 x i32> %x) {
%0:
  %cmp1 = icmp slt <2 x i32> %x, { 92, 92 }
  %cmp2 = icmp slt <2 x i32> %x, { 11, 11 }
  %r = select <2 x i1> %cmp1, <2 x i1> %cmp2, <2 x i1> { 0, 0 }
  ret <2 x i1> %r
}
Transformation seems to be correct!


----------------------------------------
define i1 @or_cmps(float %x) {
%0:
  %cmp1 = fcmp uno float %x, 42.000000
  %cmp2 = fcmp uno float %x, 52.000000
  %r = select i1 %cmp1, i1 1, i1 %cmp2
  ret i1 %r
}
=>
define i1 @or_cmps(float %x) {
%0:
  %cmp1 = fcmp uno float %x, 42.000000
  %cmp2 = fcmp uno float %x, 52.000000
  %r = select i1 %cmp1, i1 1, i1 %cmp2
  ret i1 %r
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @or_logic_vector(<2 x i1> %x, <2 x i1> %y) {
%0:
  %a = and <2 x i1> %x, %y
  %r = select <2 x i1> %x, <2 x i1> { 1, 1 }, <2 x i1> %a
  ret <2 x i1> %r
}
=>
define <2 x i1> @or_logic_vector(<2 x i1> %x, <2 x i1> %y) {
%0:
  %a = and <2 x i1> %x, %y
  %r = select <2 x i1> %x, <2 x i1> { 1, 1 }, <2 x i1> %a
  ret <2 x i1> %r
}
Transformation seems to be correct!


----------------------------------------
define i1 @and_not_cmps(i32 %x) {
%0:
  %cmp1 = icmp slt i32 %x, 92
  %cmp2 = icmp slt i32 %x, 11
  %r = select i1 %cmp1, i1 0, i1 %cmp2
  ret i1 %r
}
=>
define i1 @and_not_cmps(i32 %x) {
%0:
  %cmp1 = icmp slt i32 %x, 92
  %cmp2 = icmp slt i32 %x, 11
  %r = select i1 %cmp1, i1 0, i1 %cmp2
  ret i1 %r
}
Transformation seems to be correct!


----------------------------------------
define i1 @or_not_cmps(i32 %x) {
%0:
  %cmp1 = icmp slt i32 %x, 92
  %cmp2 = icmp slt i32 %x, 11
  %r = select i1 %cmp1, i1 %cmp2, i1 1
  ret i1 %r
}
=>
define i1 @or_not_cmps(i32 %x) {
%0:
  %cmp1 = icmp slt i32 %x, 92
  %cmp2 = icmp slt i32 %x, 11
  %r = select i1 %cmp1, i1 %cmp2, i1 1
  ret i1 %r
}
Transformation seems to be correct!


----------------------------------------
define i8 @and_cmps_wrong_type(i32 %x) {
%0:
  %cmp1 = icmp slt i32 %x, 92
  %cmp2 = icmp slt i32 %x, 11
  %s = sext i1 %cmp2 to i8
  %r = select i1 %cmp1, i8 %s, i8 0
  ret i8 %r
}
=>
define i8 @and_cmps_wrong_type(i32 %x) {
%0:
  %cmp1 = icmp slt i32 %x, 92
  %cmp2 = icmp slt i32 %x, 11
  %s = sext i1 %cmp2 to i8
  %r = select i1 %cmp1, i8 %s, i8 0
  ret i8 %r
}
Transformation seems to be correct!


----------------------------------------
define i1 @y_might_be_poison(float %x, float %y) {
%0:
  %c1 = fcmp ord float 0.000000, %x
  %c2 = fcmp ord float %x, %y
  %c3 = select i1 %c1, i1 %c2, i1 0
  ret i1 %c3
}
=>
define i1 @y_might_be_poison(float %x, float %y) {
%0:
  %c1 = fcmp ord float 0.000000, %x
  %c2 = fcmp ord float %x, %y
  %c3 = select i1 %c1, i1 %c2, i1 0
  ret i1 %c3
}
Transformation seems to be correct!


----------------------------------------
define i32 @false_undef(i1 %cond, i32 %x) {
%0:
  %s = select i1 %cond, i32 %x, i32 undef
  ret i32 %s
}
=>
define i32 @false_undef(i1 %cond, i32 %x) {
%0:
  ret i32 %x
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source

Example:
i1 %cond = #x0 (0)
i32 %x = poison

Source:
i32 %s = undef

Target:
Source value: undef
Target value: poison


------------------- SMT STATS -------------------
Num queries: 149
Num invalid: 0
Num skips:   0
Num trivial: 257 (63.3%)
Num timeout: 2 (1.3%)
Num errors:  0 (0.0%)
Num SAT:     69 (46.3%)
Num UNSAT:   78 (52.3%)

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/scripts/opt-alive.sh -instsimplify -S
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstSimplify/select.ll

Alive2: Transform doesn't verify; aborting!
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstSimplify/select.ll

 

<-- Back