<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 - [SystemZ] Cannot select SystemZISD::GET_CCMASK with usubo"
   href="https://bugs.llvm.org/show_bug.cgi?id=42512">42512</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[SystemZ] Cannot select SystemZISD::GET_CCMASK with usubo
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Backend: SystemZ
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nikita.ppv@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64"
target triple = "s390x-unknown-linux-gnu"

define i8 @test(i8 %x) {
  %usubo = tail call { i64, i1 } @llvm.usub.with.overflow.i64(i64 undef, i64 1)
  %ov = extractvalue { i64, i1 } %usubo, 1
  %ovext = zext i1 %ov to i8
  %ret = add i8 %x, %ovext
  ret i8 %ret
}

; Function Attrs: nounwind readnone speculatable
declare { i64, i1 } @llvm.usub.with.overflow.i64(i64, i64) #0

attributes #0 = { nounwind readnone speculatable }


Produces:


LLVM ERROR: Cannot select: t21: i32 = SystemZISD::GET_CCMASK t34,
Constant:i32<15>, Constant:i32<3>
  t34: i32 = srl t32, Constant:i32<31>
    t32: i32 = add t30, Constant:i32<-536870912>
      t30: i32 = SystemZISD::IPM t26:1
        t26: i64,i32 = SystemZISD::USUBO undef:i64, Constant:i64<1>
          t4: i64 = undef
          t5: i64 = Constant<1>
      t31: i32 = Constant<-536870912>
    t33: i32 = Constant<31>
  t20: i32 = Constant<15>
  t19: i32 = Constant<3>
In function: test</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>