Skip to content

Commit 89a2c38

Browse files
committed
Only use SVE addv reductions when using SVE for fixed length vectors.
This avoids the combine for cases where NEON can use a more optimal set of instructions.
1 parent 0b1fe64 commit 89a2c38

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18174,15 +18174,17 @@ performVecReduceAddExtCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
1817418174
N->getOperand(0).getOpcode() != ISD::SIGN_EXTEND)
1817518175
return SDValue();
1817618176

18177+
SelectionDAG &DAG = DCI.DAG;
18178+
const auto &ST = DAG.getSubtarget<AArch64Subtarget>();
1817718179
SDValue VecOp = N->getOperand(0).getOperand(0);
1817818180
EVT VecOpVT = VecOp.getValueType();
1817918181
if (VecOpVT.getScalarType() == MVT::i1 || !TLI.isTypeLegal(VecOpVT) ||
1818018182
(VecOpVT.isFixedLengthVector() &&
18181-
!TLI.useSVEForFixedLengthVectorVT(VecOpVT, /*OverrideNEON=*/true)))
18183+
!TLI.useSVEForFixedLengthVectorVT(
18184+
VecOpVT, /*OverrideNEON=*/ST.useSVEForFixedLengthVectors())))
1818218185
return SDValue();
1818318186

1818418187
SDLoc DL(N);
18185-
SelectionDAG &DAG = DCI.DAG;
1818618188

1818718189
// The input type is legal so map VECREDUCE_ADD to UADDV/SADDV, e.g.
1818818190
// i32 (vecreduce_add (zext nxv16i8 %op to nxv16i32))

0 commit comments

Comments
 (0)