Closed
Description
llvm-project/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Lines 2158 to 2200 in f1ade1f
Alive2 report: https://alive2.llvm.org/ce/z/n2TNxF
----------------------------------------
define <2 x i8> @t5_splat_undef_0b1000.2(<2 x i8> %x) {
#0:
%#1 = xor <2 x i8> %x, { 15, undef }
%x.lowbits.are.zero = icmp eq <2 x i8> %#1, { 0, 0 }
%x.biased = add <2 x i8> %x, { 16, 16 }
%x.biased.highbits = and <2 x i8> %x.biased, { 240, 240 }
%x.roundedup = select <2 x i1> %x.lowbits.are.zero, <2 x i8> %x, <2 x i8> %x.biased.highbits
ret <2 x i8> %x.roundedup
}
=>
define <2 x i8> @t5_splat_undef_0b1000.2(<2 x i8> %x) {
#0:
%x.lowbits.are.zero = icmp eq <2 x i8> %x, { 15, undef }
%#1 = and <2 x i8> %x, { 240, 240 }
%x.biased.highbits = add <2 x i8> %#1, { 16, 16 }
%x.roundedup = select <2 x i1> %x.lowbits.are.zero, <2 x i8> { 15, undef }, <2 x i8> %x.biased.highbits
ret <2 x i8> %x.roundedup
}
Transformation doesn't verify!
ERROR: Value mismatch
Example:
<2 x i8> %x = < #x00 (0), #x00 (0) >
Source:
<2 x i8> %#1 = < #x0f (15), #x00 (0) [based on undef value] >
<2 x i1> %x.lowbits.are.zero = < #x0 (0), #x1 (1) >
<2 x i8> %x.biased = < #x10 (16), #x10 (16) >
<2 x i8> %x.biased.highbits = < #x10 (16), #x10 (16) >
<2 x i8> %x.roundedup = < #x10 (16), #x00 (0) >
Target:
<2 x i1> %x.lowbits.are.zero = < #x0 (0), #x1 (1) >
<2 x i8> %#1 = < #x00 (0), #x00 (0) >
<2 x i8> %x.biased.highbits = < #x10 (16), #x10 (16) >
<2 x i8> %x.roundedup = < #x10 (16), #x02 (2) >
Source value: < #x10 (16), #x00 (0) >
Target value: < #x10 (16), #x02 (2) >
----------------------------------------
define i8 @t5_splat_undef_0b1000.3(i8 %x) {
#0:
%#1 = xor i8 %x, undef
%x.lowbits.are.zero = icmp eq i8 %#1, 0
%x.biased = add i8 %x, 16
%x.biased.highbits = and i8 %x.biased, 240
%x.roundedup = select i1 %x.lowbits.are.zero, i8 %x, i8 %x.biased.highbits
ret i8 %x.roundedup
}
=>
define i8 @t5_splat_undef_0b1000.3(i8 %x) {
#0:
ret i8 %x
}
Transformation seems to be correct!
Summary:
1 correct transformations
1 incorrect transformations
0 failed-to-prove transformations
0 Alive2 errors