Test Failure: Transforms/InstCombine/canonicalize-clamp-like-pattern-between-zero-and-positive-threshold.ll

Test source: git

Comments: LLVM PR45954

Log:

Source: <stdin>

----------------------------------------
define i32 @t0_ult_slt_65536(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 65536
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @t0_ult_slt_65536(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %1 = icmp slt i32 %x, 0
  %2 = icmp sgt i32 %x, 65535
  %3 = select i1 %1, i32 %replacement_low, i32 %x
  %r = select i1 %2, i32 %replacement_high, i32 %3
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @t1_ult_slt_0(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 0
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @t1_ult_slt_0(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %1 = icmp slt i32 %x, 0
  %2 = icmp sgt i32 %x, 65535
  %3 = select i1 %1, i32 %replacement_low, i32 %x
  %r = select i1 %2, i32 %replacement_high, i32 %3
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @t2_ult_sgt_65536(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp sgt i32 %x, 65535
  %t1 = select i1 %t0, i32 %replacement_high, i32 %replacement_low
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @t2_ult_sgt_65536(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %1 = icmp slt i32 %x, 0
  %2 = icmp sgt i32 %x, 65535
  %3 = select i1 %1, i32 %replacement_low, i32 %x
  %r = select i1 %2, i32 %replacement_high, i32 %3
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @t3_ult_sgt_neg1(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp sgt i32 %x, 4294967295
  %t1 = select i1 %t0, i32 %replacement_high, i32 %replacement_low
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @t3_ult_sgt_neg1(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %1 = icmp slt i32 %x, 0
  %2 = icmp sgt i32 %x, 65535
  %3 = select i1 %1, i32 %replacement_low, i32 %x
  %r = select i1 %2, i32 %replacement_high, i32 %3
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @t4_ugt_slt_65536(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 65536
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ugt i32 %x, 65535
  %r = select i1 %t2, i32 %t1, i32 %x
  ret i32 %r
}
=>
define i32 @t4_ugt_slt_65536(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %1 = icmp slt i32 %x, 0
  %2 = icmp sgt i32 %x, 65535
  %3 = select i1 %1, i32 %replacement_low, i32 %x
  %r = select i1 %2, i32 %replacement_high, i32 %3
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @t5_ugt_slt_0(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 0
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ugt i32 %x, 65535
  %r = select i1 %t2, i32 %t1, i32 %x
  ret i32 %r
}
=>
define i32 @t5_ugt_slt_0(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %1 = icmp slt i32 %x, 0
  %2 = icmp sgt i32 %x, 65535
  %3 = select i1 %1, i32 %replacement_low, i32 %x
  %r = select i1 %2, i32 %replacement_high, i32 %3
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @t6_ugt_sgt_65536(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp sgt i32 %x, 65535
  %t1 = select i1 %t0, i32 %replacement_high, i32 %replacement_low
  %t2 = icmp ugt i32 %x, 65535
  %r = select i1 %t2, i32 %t1, i32 %x
  ret i32 %r
}
=>
define i32 @t6_ugt_sgt_65536(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %1 = icmp slt i32 %x, 0
  %2 = icmp sgt i32 %x, 65535
  %3 = select i1 %1, i32 %replacement_low, i32 %x
  %r = select i1 %2, i32 %replacement_high, i32 %3
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @t7_ugt_sgt_neg1(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp sgt i32 %x, 4294967295
  %t1 = select i1 %t0, i32 %replacement_high, i32 %replacement_low
  %t2 = icmp ugt i32 %x, 65535
  %r = select i1 %t2, i32 %t1, i32 %x
  ret i32 %r
}
=>
define i32 @t7_ugt_sgt_neg1(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %1 = icmp slt i32 %x, 0
  %2 = icmp sgt i32 %x, 65535
  %3 = select i1 %1, i32 %replacement_low, i32 %x
  %r = select i1 %2, i32 %replacement_high, i32 %3
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @n8_ult_slt_65537(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 65537
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @n8_ult_slt_65537(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 65537
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @n9_ult_slt_neg1(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 4294967295
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @n9_ult_slt_neg1(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 4294967295
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @n10_oneuse0(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  call void @use1(i1 %t2)
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @n10_oneuse0(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  call void @use1(i1 %t2)
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @n11_oneuse1(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  call void @use1(i1 %t0)
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @n11_oneuse1(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  call void @use1(i1 %t0)
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @n12_oneuse2(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  call void @use32(i32 %t1)
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @n12_oneuse2(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  call void @use32(i32 %t1)
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @n13_oneuse3(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  call void @use1(i1 %t0)
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  call void @use1(i1 %t2)
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @n13_oneuse3(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  call void @use1(i1 %t0)
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  %t2 = icmp ult i32 %x, 65536
  call void @use1(i1 %t2)
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @n14_oneuse4(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  call void @use1(i1 %t0)
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  call void @use32(i32 %t1)
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @n14_oneuse4(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  call void @use1(i1 %t0)
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  call void @use32(i32 %t1)
  %t2 = icmp ult i32 %x, 65536
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @n15_oneuse5(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  call void @use32(i32 %t1)
  %t2 = icmp ult i32 %x, 65536
  call void @use1(i1 %t2)
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @n15_oneuse5(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  call void @use32(i32 %t1)
  %t2 = icmp ult i32 %x, 65536
  call void @use1(i1 %t2)
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @n16_oneuse6(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  call void @use1(i1 %t0)
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  call void @use32(i32 %t1)
  %t2 = icmp ult i32 %x, 65536
  call void @use1(i1 %t2)
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
=>
define i32 @n16_oneuse6(i32 %x, i32 %replacement_low, i32 %replacement_high) {
%0:
  %t0 = icmp slt i32 %x, 32768
  call void @use1(i1 %t0)
  %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
  call void @use32(i32 %t1)
  %t2 = icmp ult i32 %x, 65536
  call void @use1(i1 %t2)
  %r = select i1 %t2, i32 %x, i32 %t1
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @t17_ult_slt_vec_splat(<2 x i32> %x, <2 x i32> %replacement_low, <2 x i32> %replacement_high) {
%0:
  %t0 = icmp slt <2 x i32> %x, { 65536, 65536 }
  %t1 = select <2 x i1> %t0, <2 x i32> %replacement_low, <2 x i32> %replacement_high
  %t2 = icmp ult <2 x i32> %x, { 65536, 65536 }
  %r = select <2 x i1> %t2, <2 x i32> %x, <2 x i32> %t1
  ret <2 x i32> %r
}
=>
define <2 x i32> @t17_ult_slt_vec_splat(<2 x i32> %x, <2 x i32> %replacement_low, <2 x i32> %replacement_high) {
%0:
  %1 = icmp slt <2 x i32> %x, { 0, 0 }
  %2 = icmp sgt <2 x i32> %x, { 65535, 65535 }
  %3 = select <2 x i1> %1, <2 x i32> %replacement_low, <2 x i32> %x
  %r = select <2 x i1> %2, <2 x i32> %replacement_high, <2 x i32> %3
  ret <2 x i32> %r
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @t18_ult_slt_vec_nonsplat(<2 x i32> %x, <2 x i32> %replacement_low, <2 x i32> %replacement_high) {
%0:
  %t0 = icmp slt <2 x i32> %x, { 65536, 32768 }
  %t1 = select <2 x i1> %t0, <2 x i32> %replacement_low, <2 x i32> %replacement_high
  %t2 = icmp ult <2 x i32> %x, { 65536, 32768 }
  %r = select <2 x i1> %t2, <2 x i32> %x, <2 x i32> %t1
  ret <2 x i32> %r
}
=>
define <2 x i32> @t18_ult_slt_vec_nonsplat(<2 x i32> %x, <2 x i32> %replacement_low, <2 x i32> %replacement_high) {
%0:
  %1 = icmp slt <2 x i32> %x, { 0, 0 }
  %2 = icmp sgt <2 x i32> %x, { 65535, 32767 }
  %3 = select <2 x i1> %1, <2 x i32> %replacement_low, <2 x i32> %x
  %r = select <2 x i1> %2, <2 x i32> %replacement_high, <2 x i32> %3
  ret <2 x i32> %r
}
Transformation seems to be correct!


----------------------------------------
define <3 x i32> @t19_ult_slt_vec_undef0(<3 x i32> %x, <3 x i32> %replacement_low, <3 x i32> %replacement_high) {
%0:
  %t0 = icmp slt <3 x i32> %x, { 65536, undef, 65536 }
  %t1 = select <3 x i1> %t0, <3 x i32> %replacement_low, <3 x i32> %replacement_high
  %t2 = icmp ult <3 x i32> %x, { 65536, 65536, 65536 }
  %r = select <3 x i1> %t2, <3 x i32> %x, <3 x i32> %t1
  ret <3 x i32> %r
}
=>
define <3 x i32> @t19_ult_slt_vec_undef0(<3 x i32> %x, <3 x i32> %replacement_low, <3 x i32> %replacement_high) {
%0:
  %1 = icmp slt <3 x i32> %x, { 0, 0, 0 }
  %2 = icmp sgt <3 x i32> %x, { 65535, 65535, 65535 }
  %3 = select <3 x i1> %1, <3 x i32> %replacement_low, <3 x i32> %x
  %r = select <3 x i1> %2, <3 x i32> %replacement_high, <3 x i32> %3
  ret <3 x i32> %r
}
Transformation seems to be correct!


----------------------------------------
define <3 x i32> @t20_ult_slt_vec_undef1(<3 x i32> %x, <3 x i32> %replacement_low, <3 x i32> %replacement_high) {
%0:
  %t0 = icmp slt <3 x i32> %x, { 65536, 65537, 65536 }
  %t1 = select <3 x i1> %t0, <3 x i32> %replacement_low, <3 x i32> %replacement_high
  %t2 = icmp ult <3 x i32> %x, { 65536, undef, 65536 }
  %r = select <3 x i1> %t2, <3 x i32> %x, <3 x i32> %t1
  ret <3 x i32> %r
}
=>
define <3 x i32> @t20_ult_slt_vec_undef1(<3 x i32> %x, <3 x i32> %replacement_low, <3 x i32> %replacement_high) {
%0:
  %1 = icmp slt <3 x i32> %x, { 0, 0, 0 }
  %2 = icmp sgt <3 x i32> %x, { 65535, 65535, 65535 }
  %3 = select <3 x i1> %1, <3 x i32> %replacement_low, <3 x i32> %x
  %r = select <3 x i1> %2, <3 x i32> %replacement_high, <3 x i32> %3
  ret <3 x i32> %r
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source

Example:
<3 x i32> %x = < #x80000000 (2147483648, -2147483648), #x00010000 (65536), #x00010000 (65536) >
<3 x i32> %replacement_low = < undef, undef, undef >
<3 x i32> %replacement_high = < poison, poison, poison >

Source:
<3 x i1> %t0 = < #x1 (1), #x1 (1), #x0 (0) >
<3 x i32> %t1 = < undef, undef, poison >
<3 x i1> %t2 = < #x0 (0), undef, #x0 (0) >
<3 x i32> %r = < undef, undef, poison >

Target:
<3 x i1> %1 = < #x1 (1), #x0 (0), #x0 (0) >
<3 x i1> %2 = < #x0 (0), #x1 (1), #x1 (1) >
<3 x i32> %3 = < undef, #x00010000 (65536), #x00010000 (65536) >
<3 x i32> %r = < undef, poison, poison >
Source value: < undef, undef, poison >
Target value: < undef, poison, poison >


------------------- SMT STATS -------------------
Num queries: 96
Num invalid: 0
Num skips:   0
Num trivial: 41 (29.9%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     22 (22.9%)
Num UNSAT:   74 (77.1%)

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/scripts/opt-alive.sh -instcombine -S
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/canonicalize-clamp-like-pattern-between-zero-and-positive-threshold.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/InstCombine/canonicalize-clamp-like-pattern-between-zero-and-positive-threshold.ll

 

<-- Back