[llvm-bugs] [Bug 42209] New: Instsimplify: uadd_overflow(X, undef) is not undef

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jun 9 12:15:08 PDT 2019


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

            Bug ID: 42209
           Summary: Instsimplify: uadd_overflow(X, undef) is not undef
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: nunoplopes at sapo.pt
                CC: lebedev.ri at gmail.com, llvm-bugs at lists.llvm.org,
                    regehr at cs.utah.edu, sanjoy at playingwithpointers.com

test/Transforms/InstSimplify/call.ll contains a few incorrect transformations
when undef is involved.

For example, when %v is zero, there's no overflow, so can't fold this to undef:

define {i8, i1} @test_uadd3(i8 %v) {
%0:
  %result = uadd_overflow i8 %v, undef
  ret {i8, i1} %result
}
=>
define {i8, i1} @test_uadd3(i8 %v) {
%0:
  ret {i8, i1} undef
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:
i8 %v = #x00 (0)

Source:
{i8, i1} %result = { ?, #x0 }

Target:
Source value: { ?, #x0 }
Target value: { #x00, #x1 }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190609/b2528464/attachment.html>


More information about the llvm-bugs mailing list