Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

[SystemZ] Cannot select SystemZISD::GET_CCMASK with usubo #41482

Closed Quuxplusone closed 5 years ago

Quuxplusone commented 5 years ago
Bugzilla Link PR42512
Status RESOLVED FIXED
Importance P enhancement
Reported by Nikita Popov (nikita.ppv@gmail.com)
Reported on 2019-07-04 09:42:44 -0700
Last modified on 2019-07-05 13:38:40 -0700
Version trunk
Hardware All All
CC llvm-bugs@lists.llvm.org
Fixed by commit(s) rL365242
Attachments
Blocks
Blocked by
See also
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
Quuxplusone commented 5 years ago

Possible fix: https://reviews.llvm.org/D64213

Quuxplusone commented 5 years ago

Fixed by https://reviews.llvm.org/rL365242.