@@ -259,6 +259,19 @@ class SelectionDAGLegalize {
259259
260260} // end anonymous namespace
261261
262+ // Helper function that generates an MMO that considers the alignment of the
263+ // stack, and the size of the stack object
264+ static MachineMemOperand *getStackAlignedMMO (SDValue StackPtr,
265+ MachineFunction &MF,
266+ bool isObjectScalable) {
267+ auto &MFI = MF.getFrameInfo ();
268+ int FI = cast<FrameIndexSDNode>(StackPtr)->getIndex ();
269+ MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack (MF, FI);
270+ uint64_t ObjectSize = isObjectScalable ? ~UINT64_C (0 ) : MFI.getObjectSize (FI);
271+ return MF.getMachineMemOperand (PtrInfo, MachineMemOperand::MOStore,
272+ ObjectSize, MFI.getObjectAlign (FI));
273+ }
274+
262275// / Return a vector shuffle operation which
263276// / performs the same shuffle in terms of order or result bytes, but on a type
264277// / whose vector element type is narrower than the original shuffle type.
@@ -1379,19 +1392,6 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) {
13791392 }
13801393}
13811394
1382- // Helper function that generates an MMO that considers the alignment of the
1383- // stack, and the size of the stack object
1384- static MachineMemOperand *getStackAlignedMMO (SDValue StackPtr,
1385- MachineFunction &MF,
1386- bool isObjectScalable) {
1387- auto &MFI = MF.getFrameInfo ();
1388- int FI = cast<FrameIndexSDNode>(StackPtr)->getIndex ();
1389- MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack (MF, FI);
1390- uint64_t ObjectSize = isObjectScalable ? ~UINT64_C (0 ) : MFI.getObjectSize (FI);
1391- return MF.getMachineMemOperand (PtrInfo, MachineMemOperand::MOStore,
1392- ObjectSize, MFI.getObjectAlign (FI));
1393- }
1394-
13951395SDValue SelectionDAGLegalize::ExpandExtractFromVectorThroughStack (SDValue Op) {
13961396 SDValue Vec = Op.getOperand (0 );
13971397 SDValue Idx = Op.getOperand (1 );
0 commit comments