https://bugs.llvm.org/show_bug.cgi?id=43730

            Bug ID: 43730
           Summary: Incorrect 'icmp sle' -> 'icmp slt' w/ vectors
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Keywords: miscompilation
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

This transformation exposed in Transforms/InstCombine/icmp-vec.ll is incorrect.
The issue is that "INT_MIN <= undef" is not the same as "INT_MIN < undef".

define <2 x i1> @PR27756_2(<2 x i8> %a) {
  %cmp = icmp sle <2 x i8> %a, { undef, 0 }
  ret <2 x i1> %cmp
}
=>
define <2 x i1> @PR27756_2(<2 x i8> %a) {
  %cmp = icmp slt <2 x i8> %a, { undef, 1 }
  ret <2 x i1> %cmp
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:
<2 x i8> %a = < #x80 (128, -128), #x80 (128, -128) >

Source:
<2 x i1> %cmp = < #x1 (1), #x1 (1) >

Target:
<2 x i1> %cmp = < #x0 (0), #x1 (1) >
Source value: < #x1 (1), #x1 (1) >
Target value: < #x0 (0), #x1 (1) >

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to