@@ -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.
@@ -1379,19 +1392,6 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) {
1379
1392
}
1380
1393
}
1381
1394
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
-
1395
1395
SDValue SelectionDAGLegalize::ExpandExtractFromVectorThroughStack (SDValue Op) {
1396
1396
SDValue Vec = Op.getOperand (0 );
1397
1397
SDValue Idx = Op.getOperand (1 );
0 commit comments