1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/CodeGen/SystemZ/pr42512.ll
Nikita Popov 3920f7d8d0 [SystemZ] Fix addcarry of usubo (PR42512)
Only custom lower uaddo+addcarry or usubo+subcarry chains and leave
mixtures like usubo+addcarry or uaddo+subcarry to the generic
legalizer. Otherwise we run into issues because SystemZ uses
different CC values for carries and borrows.

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

Differential Revision: https://reviews.llvm.org/D64213

llvm-svn: 365242
2019-07-05 20:35:11 +00:00

24 lines
739 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
define i8 @test(i8 %x) {
; CHECK-LABEL: test:
; CHECK: # %bb.0:
; CHECK-NEXT: slgfi %r0, 1
; CHECK-NEXT: ipm %r0
; CHECK-NEXT: afi %r0, -536870912
; CHECK-NEXT: srl %r0, 31
; CHECK-NEXT: ar %r2, %r0
; CHECK-NEXT: br %r14
%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 }