<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Incorrect fold of uadd.with.overflow with undef"
   href="https://bugs.llvm.org/show_bug.cgi?id=43188">43188</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect fold of uadd.with.overflow with undef
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>miscompilation
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nunoplopes@sapo.pt
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>lebedev.ri@gmail.com, llvm-bugs@lists.llvm.org, nikita.ppv@gmail.com, regehr@cs.utah.edu
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Alive2 complains about a transformation in
Transforms/ConstProp/overflow-ops.ll:

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

Example:

Source:
{i8, i1} %t = { #x8e (142, -114), #x0 (0) }     [based on undef value]

Target:
Source value: { #x8e (142, -114), #x0 (0) }     [based on undef value]
Target value: { #x00 (0), #x0 (0) }


In summary, there's no value in the source that the undef can take that allows
uadd to return {0, 0}. To return 0, it has to overflow (unsigned), and hence
the 2nd value would be 1.
Two valid return values I can think off: {%a, 0}; {undef, 1}.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>