[llvm] [SelectionDAG] Use unaligned store to move AVX registers onto stack for `extractelement` (PR #78422)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 18 09:36:04 PST 2024
================
@@ -1425,9 +1426,18 @@ SDValue SelectionDAGLegalize::ExpandExtractFromVectorThroughStack(SDValue Op) {
if (!Ch.getNode()) {
// Store the value to a temporary stack slot, then LOAD the returned part.
+ auto &MF = DAG.getMachineFunction();
+ auto &MFI = MF.getFrameInfo();
StackPtr = DAG.CreateStackTemporary(VecVT);
- Ch = DAG.getStore(DAG.getEntryNode(), dl, Vec, StackPtr,
- MachinePointerInfo());
+ int FI = cast<FrameIndexSDNode>(StackPtr.getNode())->getIndex();
+ MachinePointerInfo PtrInfo =
+ MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI);
+
+ MachineMemOperand *StoreMMO =
+ MF.getMachineMemOperand(PtrInfo, MachineMemOperand::MOStore,
----------------
RKSimon wrote:
In which case please create a helper that returns the MachineMemOperand and we can create a followup patch for ExpandInsertToVectorThroughStack to use it to fix the insert case.
https://github.com/llvm/llvm-project/pull/78422
More information about the llvm-commits
mailing list