[llvm] [X86] combineStore - attempt to store i256/i512 types as v4i64/v8i64 vectors (PR #172288)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 15 06:13:19 PST 2025
================
@@ -54078,6 +54078,28 @@ static SDValue combineStore(SDNode *N, SelectionDAG &DAG,
St->getMemOperand());
}
+ // All code below attempts to move stores to FPU, early out if we can't.
+ const Function &F = DAG.getMachineFunction().getFunction();
+ bool NoImplicitFloatOps = F.hasFnAttribute(Attribute::NoImplicitFloat);
+ if (Subtarget.useSoftFloat() || NoImplicitFloatOps)
+ return SDValue();
+
+ // If we are storing a larger than legal scalar integer, see if we can cheaply
+ // handle this as a vector store, either because it already bitcasts to a
+ // vector type or the operation is likely to expand to a vector type
+ // (legalization can scalarize back if it the op failed).
+ if (VT == MVT::i256 || VT == MVT::i512) {
+ MVT VecVT = MVT::getVectorVT(MVT::i64, VT.getSizeInBits() / 64);
+ if (TLI.isTypeLegal(VecVT) && ISD::isNormalStore(St) &&
+ (mayFoldIntoVector(StoredVal, Subtarget) ||
----------------
RKSimon wrote:
yes - everything except for the isNormalStore checks as its tricky to persuade dag to create a truncated store from illegal source types.
https://github.com/llvm/llvm-project/pull/172288
More information about the llvm-commits
mailing list