Skip to content

Commit 4a890c2

Browse files
authored
[llvm][aarch64] fix copypaste typo (#120725)
moved from #119881
1 parent bb27d5e commit 4a890c2

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18430,7 +18430,7 @@ static SDValue performUADDVAddCombine(SDValue A, SelectionDAG &DAG) {
1843018430
EVT VT = A.getValueType();
1843118431
SDValue Op0 = A.getOperand(0);
1843218432
SDValue Op1 = A.getOperand(1);
18433-
if (Op0.getOpcode() != Op0.getOpcode() ||
18433+
if (Op0.getOpcode() != Op1.getOpcode() ||
1843418434
(Op0.getOpcode() != ISD::ZERO_EXTEND &&
1843518435
Op0.getOpcode() != ISD::SIGN_EXTEND))
1843618436
return SDValue();

llvm/test/CodeGen/AArch64/vecreduce-add.ll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,24 @@ entry:
7272
ret i64 %z
7373
}
7474

75+
define i64 @add_v4i32_v4i64_zsext(<4 x i32> %xi) {
76+
; CHECK-LABEL: add_v4i32_v4i64_zsext:
77+
; CHECK: // %bb.0: // %entry
78+
; CHECK-NEXT: ushll v1.2d, v0.2s, #0
79+
; CHECK-NEXT: saddw2 v0.2d, v1.2d, v0.4s
80+
; CHECK-NEXT: addp d0, v0.2d
81+
; CHECK-NEXT: fmov x0, d0
82+
; CHECK-NEXT: ret
83+
entry:
84+
%x = shufflevector <4 x i32> %xi, <4 x i32> %xi, <2 x i32> <i32 0, i32 1>
85+
%y = shufflevector <4 x i32> %xi, <4 x i32> %xi, <2 x i32> <i32 2, i32 3>
86+
%xx = zext <2 x i32> %x to <2 x i64>
87+
%yy = sext <2 x i32> %y to <2 x i64>
88+
%zz = add <2 x i64> %xx, %yy
89+
%z = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %zz)
90+
ret i64 %z
91+
}
92+
7593
define i64 @add_v2i32_v2i64_zext(<2 x i32> %x) {
7694
; CHECK-LABEL: add_v2i32_v2i64_zext:
7795
; CHECK: // %bb.0: // %entry

0 commit comments

Comments
 (0)