Test Failure: Transforms/InstCombine/abs-1.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define i32 @test_abs(i32 %x) {
%0:
  %ret = call i32 @abs()	; WARNING: unknown known function
  ret i32 %ret
}
=>
define i32 @test_abs(i32 %x) {
%0:
  %1 = abs i32 %x, 1
  ret i32 %1
}
Transformation doesn't verify!
ERROR: Invalid expr


----------------------------------------
define i64 @test_labs(i64 %x) {
%0:
  %ret = call i64 @labs()	; WARNING: unknown known function
  ret i64 %ret
}
=>
define i64 @test_labs(i64 %x) {
%0:
  %1 = abs i64 %x, 1
  ret i64 %1
}
Transformation doesn't verify!
ERROR: Invalid expr


----------------------------------------
define i64 @test_llabs(i64 %x) {
%0:
  %ret = call i64 @llabs()	; WARNING: unknown known function
  ret i64 %ret
}
=>
define i64 @test_llabs(i64 %x) {
%0:
  %1 = abs i64 %x, 1
  ret i64 %1
}
Transformation doesn't verify!
ERROR: Invalid expr


----------------------------------------
define i8 @abs_canonical_1(i8 %x) {
%0:
  %cmp = icmp sgt i8 %x, 0
  %neg = sub i8 0, %x
  %abs = select i1 %cmp, i8 %x, i8 %neg
  ret i8 %abs
}
=>
define i8 @abs_canonical_1(i8 %x) {
%0:
  %1 = abs i8 %x, 0
  ret i8 %1
}
Transformation seems to be correct!


----------------------------------------
define <2 x i8> @abs_canonical_2(<2 x i8> %x) {
%0:
  %cmp = icmp sgt <2 x i8> %x, { 255, 255 }
  %neg = sub <2 x i8> { 0, 0 }, %x
  %abs = select <2 x i1> %cmp, <2 x i8> %x, <2 x i8> %neg
  ret <2 x i8> %abs
}
=>
define <2 x i8> @abs_canonical_2(<2 x i8> %x) {
%0:
  %1 = abs <2 x i8> %x, 0
  ret <2 x i8> %1
}
Transformation seems to be correct!


----------------------------------------
define <2 x i8> @abs_canonical_2_vec_undef_elts(<2 x i8> %x) {
%0:
  %cmp = icmp sgt <2 x i8> %x, { undef, 255 }
  %neg = sub <2 x i8> { 0, 0 }, %x
  %abs = select <2 x i1> %cmp, <2 x i8> %x, <2 x i8> %neg
  ret <2 x i8> %abs
}
=>
define <2 x i8> @abs_canonical_2_vec_undef_elts(<2 x i8> %x) {
%0:
  %1 = abs <2 x i8> %x, 0
  ret <2 x i8> %1
}
Transformation seems to be correct!


----------------------------------------
define i8 @abs_canonical_3(i8 %x) {
%0:
  %cmp = icmp slt i8 %x, 0
  %neg = sub nsw i8 0, %x
  %abs = select i1 %cmp, i8 %neg, i8 %x
  ret i8 %abs
}
=>
define i8 @abs_canonical_3(i8 %x) {
%0:
  %1 = abs i8 %x, 1
  ret i8 %1
}
Transformation seems to be correct!


----------------------------------------
define i8 @abs_canonical_4(i8 %x) {
%0:
  %cmp = icmp slt i8 %x, 1
  %neg = sub i8 0, %x
  %abs = select i1 %cmp, i8 %neg, i8 %x
  ret i8 %abs
}
=>
define i8 @abs_canonical_4(i8 %x) {
%0:
  %1 = abs i8 %x, 0
  ret i8 %1
}
Transformation seems to be correct!


----------------------------------------
define i32 @abs_canonical_5(i8 %x) {
%0:
  %cmp = icmp sgt i8 %x, 0
  %conv = sext i8 %x to i32
  %neg = sub i32 0, %conv
  %abs = select i1 %cmp, i32 %conv, i32 %neg
  ret i32 %abs
}
=>
define i32 @abs_canonical_5(i8 %x) {
%0:
  %conv = sext i8 %x to i32
  %1 = abs i32 %conv, 1
  ret i32 %1
}
Transformation seems to be correct!


----------------------------------------
define i32 @abs_canonical_6(i32 %a, i32 %b) {
%0:
  %t1 = sub i32 %a, %b
  %cmp = icmp sgt i32 %t1, 4294967295
  %t2 = sub i32 %b, %a
  %abs = select i1 %cmp, i32 %t1, i32 %t2
  ret i32 %abs
}
=>
define i32 @abs_canonical_6(i32 %a, i32 %b) {
%0:
  %t1 = sub i32 %a, %b
  %1 = abs i32 %t1, 0
  ret i32 %1
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i8> @abs_canonical_7(<2 x i8> %a, <2 x i8> %b) {
%0:
  %t1 = sub <2 x i8> %a, %b
  %cmp = icmp sgt <2 x i8> %t1, { 255, 255 }
  %t2 = sub <2 x i8> %b, %a
  %abs = select <2 x i1> %cmp, <2 x i8> %t1, <2 x i8> %t2
  ret <2 x i8> %abs
}
=>
define <2 x i8> @abs_canonical_7(<2 x i8> %a, <2 x i8> %b) {
%0:
  %t1 = sub <2 x i8> %a, %b
  %1 = abs <2 x i8> %t1, 0
  ret <2 x i8> %1
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @abs_canonical_8(i32 %a) {
%0:
  %t = sub i32 0, %a
  %cmp = icmp slt i32 %t, 0
  %abs = select i1 %cmp, i32 %a, i32 %t
  ret i32 %abs
}
=>
define i32 @abs_canonical_8(i32 %a) {
%0:
  %1 = abs i32 %a, 0
  ret i32 %1
}
Transformation seems to be correct!


----------------------------------------
define i32 @abs_canonical_9(i32 %a, i32 %b) {
%0:
  %t1 = sub i32 %a, %b
  %cmp = icmp sgt i32 %t1, 4294967295
  %t2 = sub i32 %b, %a
  %abs = select i1 %cmp, i32 %t1, i32 %t2
  %add = add i32 %abs, %t2
  ret i32 %add
}
=>
define i32 @abs_canonical_9(i32 %a, i32 %b) {
%0:
  %t1 = sub i32 %a, %b
  %t2 = sub i32 %b, %a
  %1 = abs i32 %t1, 0
  %add = add i32 %1, %t2
  ret i32 %add
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @abs_canonical_10(i32 %a, i32 %b) {
%0:
  %t2 = sub i32 %b, %a
  %t1 = sub i32 %a, %b
  %cmp = icmp sgt i32 %t1, 4294967295
  %abs = select i1 %cmp, i32 %t1, i32 %t2
  ret i32 %abs
}
=>
define i32 @abs_canonical_10(i32 %a, i32 %b) {
%0:
  %t1 = sub i32 %a, %b
  %1 = abs i32 %t1, 0
  ret i32 %1
}
Transformation seems to be correct!


----------------------------------------
define i8 @nabs_canonical_1(i8 %x) {
%0:
  %cmp = icmp sgt i8 %x, 0
  %neg = sub i8 0, %x
  %abs = select i1 %cmp, i8 %neg, i8 %x
  ret i8 %abs
}
=>
define i8 @nabs_canonical_1(i8 %x) {
%0:
  %1 = abs i8 %x, 0
  %abs = sub i8 0, %1
  ret i8 %abs
}
Transformation seems to be correct!


----------------------------------------
define <2 x i8> @nabs_canonical_2(<2 x i8> %x) {
%0:
  %cmp = icmp sgt <2 x i8> %x, { 255, 255 }
  %neg = sub <2 x i8> { 0, 0 }, %x
  %abs = select <2 x i1> %cmp, <2 x i8> %neg, <2 x i8> %x
  ret <2 x i8> %abs
}
=>
define <2 x i8> @nabs_canonical_2(<2 x i8> %x) {
%0:
  %1 = abs <2 x i8> %x, 0
  %abs = sub <2 x i8> { 0, 0 }, %1
  ret <2 x i8> %abs
}
Transformation seems to be correct!


----------------------------------------
define <2 x i8> @nabs_canonical_2_vec_undef_elts(<2 x i8> %x) {
%0:
  %cmp = icmp sgt <2 x i8> %x, { 255, undef }
  %neg = sub <2 x i8> { 0, 0 }, %x
  %abs = select <2 x i1> %cmp, <2 x i8> %neg, <2 x i8> %x
  ret <2 x i8> %abs
}
=>
define <2 x i8> @nabs_canonical_2_vec_undef_elts(<2 x i8> %x) {
%0:
  %1 = abs <2 x i8> %x, 0
  %abs = sub <2 x i8> { 0, 0 }, %1
  ret <2 x i8> %abs
}
Transformation seems to be correct!


----------------------------------------
define i8 @nabs_canonical_3(i8 %x) {
%0:
  %cmp = icmp slt i8 %x, 0
  %neg = sub nsw i8 0, %x
  %abs = select i1 %cmp, i8 %x, i8 %neg
  ret i8 %abs
}
=>
define i8 @nabs_canonical_3(i8 %x) {
%0:
  %1 = abs i8 %x, 1
  %abs = sub nsw i8 0, %1
  ret i8 %abs
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source

Example:
i8 %x = #x80 (128, -128)

Source:
i1 %cmp = #x1 (1)
i8 %neg = poison
i8 %abs = #x80 (128, -128)

Target:
i8 %1 = poison
i8 %abs = poison
Source value: #x80 (128, -128)
Target value: poison


------------------- SMT STATS -------------------
Num queries: 53
Num invalid: 3
Num skips:   0
Num trivial: 52 (49.5%)
Num timeout: 3 (5.7%)
Num errors:  0 (0.0%)
Num SAT:     19 (35.8%)
Num UNSAT:   31 (58.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/abs-1.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/abs-1.ll

 

<-- Back