[llvm] [SelectionDAG] Use unaligned store to move AVX registers onto stack for `extractelement` (PR #78422)
Manish Kausik H via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 18 07:55:39 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,
----------------
Nirhar wrote:
@RKSimon We dont use the `MF.getMachineMemOperand` function call in `ExpandInsertToVectorThroughStack`. If you want I can create a helper function containing:
```
int FI = cast<FrameIndexSDNode>(StackPtr.getNode())->getIndex();
MachinePointerInfo PtrInfo =
MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI);
```
Is that okay?
https://github.com/llvm/llvm-project/pull/78422
More information about the llvm-commits
mailing list