@@ -259,6 +259,19 @@ class SelectionDAGLegalize {
259
259
260
260
} // end anonymous namespace
261
261
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
+
262
275
// / Return a vector shuffle operation which
263
276
// / performs the same shuffle in terms of order or result bytes, but on a type
264
277
// / whose vector element type is narrower than the original shuffle type.
@@ -1378,19 +1391,6 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) {
1378
1391
}
1379
1392
}
1380
1393
1381
- // Helper function that generates an MMO that considers the alignment of the
1382
- // stack, and the size of the stack object
1383
- static MachineMemOperand *getStackAlignedMMO (SDValue StackPtr,
1384
- MachineFunction &MF,
1385
- bool isObjectScalable) {
1386
- auto &MFI = MF.getFrameInfo ();
1387
- int FI = cast<FrameIndexSDNode>(StackPtr)->getIndex ();
1388
- MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack (MF, FI);
1389
- uint64_t ObjectSize = isObjectScalable ? ~UINT64_C (0 ) : MFI.getObjectSize (FI);
1390
- return MF.getMachineMemOperand (PtrInfo, MachineMemOperand::MOStore,
1391
- ObjectSize, MFI.getObjectAlign (FI));
1392
- }
1393
-
1394
1394
SDValue SelectionDAGLegalize::ExpandExtractFromVectorThroughStack (SDValue Op) {
1395
1395
SDValue Vec = Op.getOperand (0 );
1396
1396
SDValue Idx = Op.getOperand (1 );
0 commit comments