<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 - DivRemPairs is incorrect in the presence of undef"
   href="https://bugs.llvm.org/show_bug.cgi?id=42619">42619</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>DivRemPairs is incorrect in the presence of 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>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>llvm-bugs@lists.llvm.org, regehr@cs.utah.edu, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>See, for example:

$ opt -div-rem-pairs Transforms/DivRemPairs/X86/div-rem-pairs.ll

define void @decompose_illegal_srem_same_block(i32 %a, i32 %b) {
  %rem = srem i32 %a, %b
  %div = sdiv i32 %a, %b
  call void @foo(i32 %rem, i32 %div)
  ret void
}
=>
define void @decompose_illegal_srem_same_block(i32 %a, i32 %b) {
  %div = sdiv i32 %a, %b
  %1 = mul i32 %div, %b
  %2 = sub i32 %a, %1
  call void @foo(i32 %2, i32 %div)
  ret void
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
i32 %a = undef
i32 %b = #x00000001 (1)

Source:
i32 %rem = #x00000000 (0)
i32 %div = undef

Target:
i32 %div = #x7fffffff (2147483647)
i32 %1 = undef
i32 %2 = undef</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>