Skip to content

Commit 719eb11

Browse files
committed
Address review comments for custom lowering of ssubo in 32-bit
1 parent dd25caf commit 719eb11

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
200200

201201
// On P10, the default lowering generates better code using the
202202
// setbc instruction.
203-
if (!Subtarget.hasP10Vector() && isPPC64)
203+
if (!Subtarget.hasP10Vector())
204204
setOperationAction(ISD::SSUBO, MVT::i32, Custom);
205205

206206
// Match BITREVERSE to customized fast code sequence in the td file.

llvm/test/CodeGen/PowerPC/ssubo-32.ll

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
define i1 @subovfi_i32(i32 noundef %a, i32 noundef %b, ptr %c) {
77
; CHECK-LABEL: subovfi_i32:
88
; CHECK: # %bb.0: # %entry
9-
; CHECK-NEXT: sub 6, 3, 4
10-
; CHECK-NEXT: cmpwi 1, 4, 0
11-
; CHECK-NEXT: cmpw 6, 3
12-
; CHECK-NEXT: li 3, 1
13-
; CHECK-NEXT: stw 6, 0(5)
14-
; CHECK-NEXT: creqv 20, 5, 0
15-
; CHECK-NEXT: isel 3, 0, 3, 20
9+
; CHECK-NEXT: xor 6, 4, 3
10+
; CHECK-NEXT: sub 4, 3, 4
11+
; CHECK-NEXT: xor 3, 4, 3
12+
; CHECK-NEXT: stw 4, 0(5)
13+
; CHECK-NEXT: and 3, 6, 3
14+
; CHECK-NEXT: srwi 3, 3, 31
1615
; CHECK-NEXT: blr
1716
entry:
1817
%0 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 %a, i32 %b)

0 commit comments

Comments
 (0)