[llvm] [AArch64][SVE] Fold integer lane extract and store to FPR store (PR #129756)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 6 11:42:57 PST 2025
================
@@ -23946,17 +23960,49 @@ static SDValue performSTORECombine(SDNode *N,
if (SDValue Store = combineBoolVectorAndTruncateStore(DAG, ST))
return Store;
- if (ST->isTruncatingStore()) {
- EVT StoreVT = ST->getMemoryVT();
- if (!isHalvingTruncateOfLegalScalableType(ValueVT, StoreVT))
- return SDValue();
+ if (ST->isTruncatingStore() &&
+ isHalvingTruncateOfLegalScalableType(ValueVT, MemVT)) {
if (SDValue Rshrnb =
trySimplifySrlAddToRshrnb(ST->getOperand(1), DAG, Subtarget)) {
return DAG.getTruncStore(ST->getChain(), ST, Rshrnb, ST->getBasePtr(),
- StoreVT, ST->getMemOperand());
+ MemVT, ST->getMemOperand());
}
}
+ // This is an integer vector_extract_elt followed by a (possibly truncating)
+ // store. We may be able to replace this with a store of an FP subregister.
+ if (DCI.isAfterLegalizeDAG() && ST->isUnindexed() &&
+ Value.getOpcode() == ISD::EXTRACT_VECTOR_ELT) {
+ SDValue Vector = Value.getOperand(0);
+ SDValue ExtIdx = Value.getOperand(1);
+ EVT VectorVT = Vector.getValueType();
+ EVT ElemVT = VectorVT.getVectorElementType();
+ // TODO: Consider allowing Neon (a lot of churn, not necessarily better).
+ if (!VectorVT.isScalableVector())
----------------
MacDue wrote:
I think this could be enabled for Neon too, but it causes a huge amount of churn, and more code in some cases. I've not looked into it in detail yet -- so for now it's disabled.
https://github.com/llvm/llvm-project/pull/129756
More information about the llvm-commits
mailing list