Skip to content

Commit 2619e1d

Browse files
author
himadhith
committed
update checks for affected files
1 parent 73bd0ed commit 2619e1d

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19213,7 +19213,8 @@ static SDValue combineADDToSUB(SDNode *N, SelectionDAG &DAG,
1921319213
EVT VT = N->getValueType(0);
1921419214

1921519215
// Handle v2i64, v4i32, v8i16 and v16i8 types
19216-
if (!VT.isVector() || VT.getSizeInBits() != 128)
19216+
if (!(VT == MVT::v8i16 || VT == MVT::v16i8 || VT == MVT::v4i32 ||
19217+
VT == MVT::v2i64))
1921719218
return SDValue();
1921819219

1921919220
SDValue LHS = N->getOperand(0);

llvm/test/CodeGen/PowerPC/addition-vector-all-ones.ll

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
define <2 x i64> @test_v2i64(<2 x i64> %a) {
1515
; CHECK-LABEL: test_v2i64:
1616
; CHECK: # %bb.0: # %entry
17-
; CHECK-NEXT: vspltisw v3, 1
18-
; CHECK-NEXT: vupklsw v3, v3
19-
; CHECK-NEXT: vaddudm v2, v2, v3
17+
; CHECK-NEXT: xxleqv v3, v3, v3
18+
; CHECK-NEXT: vsubudm v2, v2, v3
2019
; CHECK-NEXT: blr
2120
entry:
2221
%add = add <2 x i64> %a, splat (i64 1)
@@ -27,8 +26,8 @@ entry:
2726
define <4 x i32> @test_v4i32(<4 x i32> %a) {
2827
; CHECK-LABEL: test_v4i32:
2928
; CHECK: # %bb.0: # %entry
30-
; CHECK-NEXT: vspltisw v3, 1
31-
; CHECK-NEXT: vadduwm v2, v2, v3
29+
; CHECK-NEXT: xxleqv v3, v3, v3
30+
; CHECK-NEXT: vsubuwm v2, v2, v3
3231
; CHECK-NEXT: blr
3332
entry:
3433
%add = add <4 x i32> %a, splat (i32 1)
@@ -39,8 +38,8 @@ entry:
3938
define <8 x i16> @test_v8i16(<8 x i16> %a) {
4039
; CHECK-LABEL: test_v8i16:
4140
; CHECK: # %bb.0: # %entry
42-
; CHECK-NEXT: vspltish v3, 1
43-
; CHECK-NEXT: vadduhm v2, v2, v3
41+
; CHECK-NEXT: xxleqv v3, v3, v3
42+
; CHECK-NEXT: vsubuhm v2, v2, v3
4443
; CHECK-NEXT: blr
4544
entry:
4645
%add = add <8 x i16> %a, splat (i16 1)
@@ -51,8 +50,8 @@ entry:
5150
define <16 x i8> @test_16i8(<16 x i8> %a) {
5251
; CHECK-LABEL: test_16i8:
5352
; CHECK: # %bb.0: # %entry
54-
; CHECK-NEXT: xxspltib v3, 1
55-
; CHECK-NEXT: vaddubm v2, v2, v3
53+
; CHECK-NEXT: xxleqv v3, v3, v3
54+
; CHECK-NEXT: vsububm v2, v2, v3
5655
; CHECK-NEXT: blr
5756
entry:
5857
%add = add <16 x i8> %a, splat (i8 1)

llvm/test/CodeGen/PowerPC/vec_add_sub_doubleword.ll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@ define <2 x i64> @test_add(<2 x i64> %x, <2 x i64> %y) nounwind {
1616
define <2 x i64> @increment_by_one(<2 x i64> %x) nounwind {
1717
; VSX-LABEL: increment_by_one:
1818
; VSX: # %bb.0:
19-
; VSX-NEXT: vspltisw 3, 1
20-
; VSX-NEXT: vupklsw 3, 3
21-
; VSX-NEXT: vaddudm 2, 2, 3
19+
; VSX-NEXT: xxleqv 35, 35, 35
20+
; VSX-NEXT: vsubudm 2, 2, 3
2221
; VSX-NEXT: blr
2322
;
2423
; NOVSX-LABEL: increment_by_one:
2524
; NOVSX: # %bb.0:
2625
; NOVSX-NEXT: addis 3, 2, .LCPI1_0@toc@ha
2726
; NOVSX-NEXT: addi 3, 3, .LCPI1_0@toc@l
2827
; NOVSX-NEXT: lvx 3, 0, 3
29-
; NOVSX-NEXT: vaddudm 2, 2, 3
28+
; NOVSX-NEXT: vsubudm 2, 2, 3
3029
; NOVSX-NEXT: blr
3130
%result = add <2 x i64> %x, <i64 1, i64 1>
3231
ret <2 x i64> %result

0 commit comments

Comments
 (0)