Test Failure: Transforms/InstCombine/select.ll

Test source: git

Log:

Source: <stdin>
ERROR: Unsupported type: <vscale x 2 x i1>
ERROR: Unsupported type: <vscale x 2 x i1>
ERROR: Unsupported type: <vscale x 4 x float>
ERROR: Unsupported type: <vscale x 4 x float>
ERROR: Unsupported type: <vscale x 4 x float>
ERROR: Unsupported instruction:   %cond = invoke i1 @foo()
          to label %invoke.cont unwind label %lpad
ERROR: Unsupported instruction:   %result = invoke i32 @bar()
          to label %merge unwind label %lpad

----------------------------------------
define i1 @test5(i1 %C) {
%0:
  %V = select i1 %C, i1 0, i1 1
  ret i1 %V
}
=>
define i1 @test5(i1 %C) {
%0:
  %not.C = xor i1 %C, 1
  ret i1 %not.C
}
Transformation seems to be correct!


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


----------------------------------------
define i1 @trueval_is_true(i1 %C, i1 %X) {
%0:
  %R = select i1 %C, i1 1, i1 %X
  ret i1 %R
}
=>
define i1 @trueval_is_true(i1 %C, i1 %X) {
%0:
  %R = select i1 %C, i1 1, i1 %X
  ret i1 %R
}
Transformation seems to be correct! (syntactically equal)


----------------------------------------
define <2 x i1> @trueval_is_true_vec(<2 x i1> %C, <2 x i1> %X) {
%0:
  %R = select <2 x i1> %C, <2 x i1> { 1, 1 }, <2 x i1> %X
  ret <2 x i1> %R
}
=>
define <2 x i1> @trueval_is_true_vec(<2 x i1> %C, <2 x i1> %X) {
%0:
  %R = select <2 x i1> %C, <2 x i1> { 1, 1 }, <2 x i1> %X
  ret <2 x i1> %R
}
Transformation seems to be correct! (syntactically equal)


----------------------------------------
define <2 x i1> @trueval_is_true_vec_undef_elt(<2 x i1> %C, <2 x i1> %X) {
%0:
  %R = select <2 x i1> %C, <2 x i1> { undef, 1 }, <2 x i1> %X
  ret <2 x i1> %R
}
=>
define <2 x i1> @trueval_is_true_vec_undef_elt(<2 x i1> %C, <2 x i1> %X) {
%0:
  %R = select <2 x i1> %C, <2 x i1> { undef, 1 }, <2 x i1> %X
  ret <2 x i1> %R
}
Transformation seems to be correct! (syntactically equal)


----------------------------------------
define i1 @test8(i1 %C, i1 %X) {
%0:
  %R = select i1 %C, i1 %X, i1 0
  ret i1 %R
}
=>
define i1 @test8(i1 %C, i1 %X) {
%0:
  %R = select i1 %C, i1 %X, i1 0
  ret i1 %R
}
Transformation seems to be correct! (syntactically equal)


----------------------------------------
define <2 x i1> @test8vec(<2 x i1> %C, <2 x i1> %X) {
%0:
  %R = select <2 x i1> %C, <2 x i1> %X, <2 x i1> { 0, 0 }
  ret <2 x i1> %R
}
=>
define <2 x i1> @test8vec(<2 x i1> %C, <2 x i1> %X) {
%0:
  %R = select <2 x i1> %C, <2 x i1> %X, <2 x i1> { 0, 0 }
  ret <2 x i1> %R
}
Transformation seems to be correct! (syntactically equal)

ERROR: Unsupported type: <vscale x 2 x i1>

----------------------------------------
define i1 @test9(i1 %C, i1 %X) {
%0:
  %R = select i1 %C, i1 0, i1 %X
  ret i1 %R
}
=>
define i1 @test9(i1 %C, i1 %X) {
%0:
  %not.C = xor i1 %C, 1
  %R = select i1 %not.C, i1 %X, i1 0
  ret i1 %R
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test9vec(<2 x i1> %C, <2 x i1> %X) {
%0:
  %R = select <2 x i1> %C, <2 x i1> { 0, 0 }, <2 x i1> %X
  ret <2 x i1> %R
}
=>
define <2 x i1> @test9vec(<2 x i1> %C, <2 x i1> %X) {
%0:
  %not.C = xor <2 x i1> %C, { 1, 1 }
  %R = select <2 x i1> %not.C, <2 x i1> %X, <2 x i1> { 0, 0 }
  ret <2 x i1> %R
}
Transformation seems to be correct!

ERROR: Unsupported type: <vscale x 2 x i1>

----------------------------------------
define i1 @test10(i1 %C, i1 %X) {
%0:
  %R = select i1 %C, i1 %X, i1 1
  ret i1 %R
}
=>
define i1 @test10(i1 %C, i1 %X) {
%0:
  %not.C = xor i1 %C, 1
  %R = select i1 %not.C, i1 1, i1 %X
  ret i1 %R
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test10vec(<2 x i1> %C, <2 x i1> %X) {
%0:
  %R = select <2 x i1> %C, <2 x i1> %X, <2 x i1> { 1, 1 }
  ret <2 x i1> %R
}
=>
define <2 x i1> @test10vec(<2 x i1> %C, <2 x i1> %X) {
%0:
  %not.C = xor <2 x i1> %C, { 1, 1 }
  %R = select <2 x i1> %not.C, <2 x i1> { 1, 1 }, <2 x i1> %X
  ret <2 x i1> %R
}
Transformation seems to be correct!


----------------------------------------
define i1 @test23(i1 %a, i1 %b) {
%0:
  %c = select i1 %a, i1 %b, i1 %a
  ret i1 %c
}
=>
define i1 @test23(i1 %a, i1 %b) {
%0:
  %c = select i1 %a, i1 %b, i1 0
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test23vec(<2 x i1> %a, <2 x i1> %b) {
%0:
  %c = select <2 x i1> %a, <2 x i1> %b, <2 x i1> %a
  ret <2 x i1> %c
}
=>
define <2 x i1> @test23vec(<2 x i1> %a, <2 x i1> %b) {
%0:
  %c = select <2 x i1> %a, <2 x i1> %b, <2 x i1> { 0, 0 }
  ret <2 x i1> %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @test24(i1 %a, i1 %b) {
%0:
  %c = select i1 %a, i1 %a, i1 %b
  ret i1 %c
}
=>
define i1 @test24(i1 %a, i1 %b) {
%0:
  %c = select i1 %a, i1 1, i1 %b
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test24vec(<2 x i1> %a, <2 x i1> %b) {
%0:
  %c = select <2 x i1> %a, <2 x i1> %a, <2 x i1> %b
  ret <2 x i1> %c
}
=>
define <2 x i1> @test24vec(<2 x i1> %a, <2 x i1> %b) {
%0:
  %c = select <2 x i1> %a, <2 x i1> { 1, 1 }, <2 x i1> %b
  ret <2 x i1> %c
}
Transformation seems to be correct!


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


----------------------------------------
define <2 x i1> @test62vec(<2 x i1> %A, <2 x i1> %B) {
%0:
  %not = xor <2 x i1> %A, { 1, 1 }
  %C = select <2 x i1> %A, <2 x i1> %not, <2 x i1> %B
  ret <2 x i1> %C
}
=>
define <2 x i1> @test62vec(<2 x i1> %A, <2 x i1> %B) {
%0:
  %not = xor <2 x i1> %A, { 1, 1 }
  %C = select <2 x i1> %not, <2 x i1> %B, <2 x i1> { 0, 0 }
  ret <2 x i1> %C
}
Transformation seems to be correct!


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


----------------------------------------
define <2 x i1> @test63vec(<2 x i1> %A, <2 x i1> %B) {
%0:
  %not = xor <2 x i1> %A, { 1, 1 }
  %C = select <2 x i1> %A, <2 x i1> %B, <2 x i1> %not
  ret <2 x i1> %C
}
=>
define <2 x i1> @test63vec(<2 x i1> %A, <2 x i1> %B) {
%0:
  %not = xor <2 x i1> %A, { 1, 1 }
  %C = select <2 x i1> %not, <2 x i1> { 1, 1 }, <2 x i1> %B
  ret <2 x i1> %C
}
Transformation seems to be correct!


----------------------------------------
define i32 @test11(i32 %a) {
%0:
  %C = icmp eq i32 %a, 0
  %R = select i1 %C, i32 0, i32 1
  ret i32 %R
}
=>
define i32 @test11(i32 %a) {
%0:
  %C = icmp ne i32 %a, 0
  %R = zext i1 %C to i32
  ret i32 %R
}
Transformation seems to be correct!


----------------------------------------
define i32 @test12(i1 %cond, i32 %a) {
%0:
  %b = or i32 %a, 1
  %c = select i1 %cond, i32 %b, i32 %a
  ret i32 %c
}
=>
define i32 @test12(i1 %cond, i32 %a) {
%0:
  %b = zext i1 %cond to i32
  %c = or i32 %b, %a
  ret i32 %c
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test12vec(<2 x i1> %cond, <2 x i32> %a) {
%0:
  %b = or <2 x i32> %a, { 1, 1 }
  %c = select <2 x i1> %cond, <2 x i32> %b, <2 x i32> %a
  ret <2 x i32> %c
}
=>
define <2 x i32> @test12vec(<2 x i1> %cond, <2 x i32> %a) {
%0:
  %b = zext <2 x i1> %cond to <2 x i32>
  %c = or <2 x i32> %b, %a
  ret <2 x i32> %c
}
Transformation seems to be correct!


----------------------------------------
define i32 @test12a(i1 %cond, i32 %a) {
%0:
  %b = ashr i32 %a, 1
  %c = select i1 %cond, i32 %b, i32 %a
  ret i32 %c
}
=>
define i32 @test12a(i1 %cond, i32 %a) {
%0:
  %b = zext i1 %cond to i32
  %c = ashr i32 %a, %b
  ret i32 %c
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test12avec(<2 x i1> %cond, <2 x i32> %a) {
%0:
  %b = ashr <2 x i32> %a, { 1, 1 }
  %c = select <2 x i1> %cond, <2 x i32> %b, <2 x i32> %a
  ret <2 x i32> %c
}
=>
define <2 x i32> @test12avec(<2 x i1> %cond, <2 x i32> %a) {
%0:
  %b = zext <2 x i1> %cond to <2 x i32>
  %c = ashr <2 x i32> %a, %b
  ret <2 x i32> %c
}
Transformation seems to be correct!


----------------------------------------
define i32 @test12b(i1 %cond, i32 %a) {
%0:
  %b = ashr i32 %a, 1
  %d = select i1 %cond, i32 %a, i32 %b
  ret i32 %d
}
=>
define i32 @test12b(i1 %cond, i32 %a) {
%0:
  %not.cond = xor i1 %cond, 1
  %b = zext i1 %not.cond to i32
  %d = ashr i32 %a, %b
  ret i32 %d
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test12bvec(<2 x i1> %cond, <2 x i32> %a) {
%0:
  %b = ashr <2 x i32> %a, { 1, 1 }
  %d = select <2 x i1> %cond, <2 x i32> %a, <2 x i32> %b
  ret <2 x i32> %d
}
=>
define <2 x i32> @test12bvec(<2 x i1> %cond, <2 x i32> %a) {
%0:
  %not.cond = xor <2 x i1> %cond, { 1, 1 }
  %b = zext <2 x i1> %not.cond to <2 x i32>
  %d = ashr <2 x i32> %a, %b
  ret <2 x i32> %d
}
Transformation seems to be correct!


----------------------------------------
define i32 @test13(i32 %a, i32 %b) {
%0:
  %C = icmp eq i32 %a, %b
  %V = select i1 %C, i32 %a, i32 %b
  ret i32 %V
}
=>
define i32 @test13(i32 %a, i32 %b) {
%0:
  ret i32 %b
}
Transformation seems to be correct!


----------------------------------------
define i32 @test13a(i32 %a, i32 %b) {
%0:
  %C = icmp ne i32 %a, %b
  %V = select i1 %C, i32 %a, i32 %b
  ret i32 %V
}
=>
define i32 @test13a(i32 %a, i32 %b) {
%0:
  ret i32 %a
}
Transformation seems to be correct!


----------------------------------------
define i32 @test13b(i32 %a, i32 %b) {
%0:
  %C = icmp eq i32 %a, %b
  %V = select i1 %C, i32 %b, i32 %a
  ret i32 %V
}
=>
define i32 @test13b(i32 %a, i32 %b) {
%0:
  ret i32 %a
}
Transformation seems to be correct!


----------------------------------------
define i1 @test14a(i1 %C, i32 %X) {
%0:
  %V = select i1 %C, i32 %X, i32 0
  %R = icmp slt i32 %V, 1
  ret i1 %R
}
=>
define i1 @test14a(i1 %C, i32 %X) {
%0:
  %R1 = icmp slt i32 %X, 1
  %not.C = xor i1 %C, 1
  %R = select i1 %not.C, i1 1, i1 %R1
  ret i1 %R
}
Transformation seems to be correct!


----------------------------------------
define i1 @test14b(i1 %C, i32 %X) {
%0:
  %V = select i1 %C, i32 0, i32 %X
  %R = icmp slt i32 %V, 1
  ret i1 %R
}
=>
define i1 @test14b(i1 %C, i32 %X) {
%0:
  %R1 = icmp slt i32 %X, 1
  %R = select i1 %C, i1 1, i1 %R1
  ret i1 %R
}
Transformation seems to be correct!


----------------------------------------
define i32 @test16(i1 %C, * %P) {
%0:
  %P2 = select i1 %C, * %P, * null
  %V = load i32, * %P2, align 4
  ret i32 %V
}
=>
define i32 @test16(i1 %C, * %P) {
%0:
  %V = load i32, * %P, align 4
  ret i32 %V
}
Transformation seems to be correct!


----------------------------------------
define i32 @test16_no_null_opt(i1 %C, * %P) {
%0:
  %P2 = select i1 %C, * %P, * null
  %V = load i32, * %P2, align 4
  ret i32 %V
}
=>
define i32 @test16_no_null_opt(i1 %C, * %P) {
%0:
  %P2 = select i1 %C, * %P, * null
  %V = load i32, * %P2, align 4
  ret i32 %V
}
Transformation seems to be correct! (syntactically equal)


----------------------------------------
define i32 @test16_no_null_opt_2(i1 %C, * %P) {
%0:
  %P2 = select i1 %C, * null, * %P
  %V = load i32, * %P2, align 4
  ret i32 %V
}
=>
define i32 @test16_no_null_opt_2(i1 %C, * %P) {
%0:
  %P2 = select i1 %C, * null, * %P
  %V = load i32, * %P2, align 4
  ret i32 %V
}
Transformation seems to be correct! (syntactically equal)


----------------------------------------
define i1 @test17(* %X, i1 %C) {
%0:
  %R = select i1 %C, * %X, * null
  %RV = icmp eq * %R, null
  ret i1 %RV
}
=>
define i1 @test17(* %X, i1 %C) {
%0:
  %RV1 = icmp eq * %X, null
  %not.C = xor i1 %C, 1
  %RV = select i1 %not.C, i1 1, i1 %RV1
  ret i1 %RV
}
Transformation seems to be correct!


----------------------------------------
define i32 @test18(i32 %X, i32 %Y, i1 %C) {
%0:
  %R = select i1 %C, i32 %X, i32 0
  %V = sdiv i32 %Y, %R
  ret i32 %V
}
=>
define i32 @test18(i32 %X, i32 %Y, i1 %C) {
%0:
  %V = sdiv i32 %Y, %X
  ret i32 %V
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test19(i32 %x) {
%0:
  %t = icmp ugt i32 %x, 2147483647
  %retval = select i1 %t, i32 4294967295, i32 0
  ret i32 %retval
}
=>
define i32 @test19(i32 %x) {
%0:
  %x.lobit = ashr i32 %x, 31
  ret i32 %x.lobit
}
Transformation seems to be correct!


----------------------------------------
define i32 @test20(i32 %x) {
%0:
  %t = icmp slt i32 %x, 0
  %retval = select i1 %t, i32 4294967295, i32 0
  ret i32 %retval
}
=>
define i32 @test20(i32 %x) {
%0:
  %x.lobit = ashr i32 %x, 31
  ret i32 %x.lobit
}
Transformation seems to be correct!


----------------------------------------
define i64 @test21(i32 %x) {
%0:
  %t = icmp slt i32 %x, 0
  %retval = select i1 %t, i64 -1, i64 0
  ret i64 %retval
}
=>
define i64 @test21(i32 %x) {
%0:
  %x.lobit = ashr i32 %x, 31
  %1 = sext i32 %x.lobit to i64
  ret i64 %1
}
Transformation seems to be correct!


----------------------------------------
define i16 @test22(i32 %x) {
%0:
  %t = icmp slt i32 %x, 0
  %retval = select i1 %t, i16 65535, i16 0
  ret i16 %retval
}
=>
define i16 @test22(i32 %x) {
%0:
  %x.lobit = ashr i32 %x, 31
  %1 = trunc i32 %x.lobit to i16
  ret i16 %1
}
Transformation seems to be correct!


----------------------------------------
define i32 @test25(i1 %c) {
%entry:
  br i1 %c, label %jump, label %ret

%jump:
  br label %ret

%ret:
  %a = phi i1 [ 1, %jump ], [ 0, %entry ]
  %b = select i1 %a, i32 10, i32 20
  ret i32 %b
}
=>
define i32 @test25(i1 %c) {
%entry:
  br i1 %c, label %jump, label %ret

%jump:
  br label %ret

%ret:
  %b = phi i32 [ 10, %jump ], [ 20, %entry ]
  ret i32 %b
}
Transformation seems to be correct!


----------------------------------------
define i32 @test26(i1 %cond) {
%entry:
  br i1 %cond, label %jump, label %ret

%jump:
  %c = or i1 0, 0
  br label %ret

%ret:
  %a = phi i1 [ 1, %entry ], [ %c, %jump ]
  %b = select i1 %a, i32 20, i32 10
  ret i32 %b
}
=>
define i32 @test26(i1 %cond) {
%entry:
  br i1 %cond, label %jump, label %ret

%jump:
  br label %ret

%ret:
  %b = phi i32 [ 10, %jump ], [ 20, %entry ]
  ret i32 %b
}
Transformation seems to be correct!


----------------------------------------
define i32 @test26_logical(i1 %cond) {
%entry:
  br i1 %cond, label %jump, label %ret

%jump:
  %c = select i1 0, i1 1, i1 0
  br label %ret

%ret:
  %a = phi i1 [ 1, %entry ], [ %c, %jump ]
  %b = select i1 %a, i32 20, i32 10
  ret i32 %b
}
=>
define i32 @test26_logical(i1 %cond) {
%entry:
  br i1 %cond, label %jump, label %ret

%jump:
  br label %ret

%ret:
  %b = phi i32 [ 10, %jump ], [ 20, %entry ]
  ret i32 %b
}
Transformation seems to be correct!


----------------------------------------
define i32 @test27(i1 %c, i32 %A, i32 %B) {
%entry:
  br i1 %c, label %jump, label %ret

%jump:
  br label %ret

%ret:
  %p = phi i1 [ 1, %jump ], [ 0, %entry ]
  %s = select i1 %p, i32 %A, i32 %B
  ret i32 %s
}
=>
define i32 @test27(i1 %c, i32 %A, i32 %B) {
%entry:
  br i1 %c, label %jump, label %ret

%jump:
  br label %ret

%ret:
  %s = phi i32 [ %A, %jump ], [ %B, %entry ]
  ret i32 %s
}
Transformation seems to be correct!


----------------------------------------
define i32 @test28(i1 %cond, i32 %A, i32 %B) {
%entry:
  br i1 %cond, label %jump, label %ret

%jump:
  br label %ret

%ret:
  %c = phi i32 [ %A, %jump ], [ %B, %entry ]
  %p = phi i1 [ 1, %jump ], [ 0, %entry ]
  %s = select i1 %p, i32 %A, i32 %c
  ret i32 %s
}
=>
define i32 @test28(i1 %cond, i32 %A, i32 %B) {
%entry:
  br i1 %cond, label %jump, label %ret

%jump:
  br label %ret

%ret:
  %s = phi i32 [ %A, %jump ], [ %B, %entry ]
  ret i32 %s
}
Transformation seems to be correct!


----------------------------------------
define i32 @test29(i1 %cond, i32 %A, i32 %B) {
%entry:
  br i1 %cond, label %jump, label %ret

%jump:
  br label %ret

%ret:
  %c = phi i32 [ %A, %jump ], [ %B, %entry ]
  %p = phi i1 [ 1, %jump ], [ 0, %entry ]
  br label %next

%next:
  %s = select i1 %p, i32 %A, i32 %c
  ret i32 %s
}
=>
define i32 @test29(i1 %cond, i32 %A, i32 %B) {
%entry:
  br i1 %cond, label %jump, label %ret

%jump:
  br label %ret

%ret:
  %s = phi i32 [ %A, %jump ], [ %B, %entry ]
  br label %next

%next:
  ret i32 %s
}
Transformation seems to be correct!


----------------------------------------
define i32 @test30(i32 %x, i32 %y) {
%0:
  %cmp = icmp sgt i32 %x, %y
  %cond = select i1 %cmp, i32 %x, i32 %y
  %cmp5 = icmp sgt i32 %cond, %x
  %retval = select i1 %cmp5, i32 %cond, i32 %x
  ret i32 %retval
}
=>
define i32 @test30(i32 %x, i32 %y) {
%0:
  %cmp = icmp sgt i32 %x, %y
  %cond = select i1 %cmp, i32 %x, i32 %y
  ret i32 %cond
}
Transformation doesn't verify!
ERROR: Target's return value is more undefined

Example:
i32 %x = #x7fffffff (2147483647)
i32 %y = undef

Source:
i1 %cmp = any
i32 %cond = any
i1 %cmp5 = #x0 (0)
i32 %retval = #x7fffffff (2147483647)

Target:
i1 %cmp = #x0 (0)
i32 %cond = #x00000000 (0)
Source value: #x7fffffff (2147483647)
Target value: #x00000000 (0)


------------------- SMT STATS -------------------
Num queries: 218
Num invalid: 0
Num skips:   0
Num trivial: 151 (40.9%)
Num timeout: 1 (0.5%)
Num errors:  0 (0.0%)
Num SAT:     121 (55.5%)
Num UNSAT:   96 (44.0%)
Alive2: Transform doesn't verify; aborting!

stderr:

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

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/select.ll

 

NOTE: This test would pass if undef didn't exist!

 

<-- Back