@@ -599,7 +599,7 @@ void AArch64FrameLowering::emitCalleeSavedGPRLocations(
599599 MachineFunction &MF = *MBB.getParent ();
600600 MachineFrameInfo &MFI = MF.getFrameInfo ();
601601 AArch64FunctionInfo *AFI = MF.getInfo <AArch64FunctionInfo>();
602- SMEAttrs Attrs (MF. getFunction () );
602+ SMEAttrs Attrs = AFI-> getSMEFnAttrs ( );
603603 bool LocallyStreaming =
604604 Attrs.hasStreamingBody () && !Attrs.hasStreamingInterface ();
605605
@@ -3026,7 +3026,7 @@ bool enableMultiVectorSpillFill(const AArch64Subtarget &Subtarget,
30263026 if (DisableMultiVectorSpillFill)
30273027 return false ;
30283028
3029- SMEAttrs FuncAttrs ( MF.getFunction () );
3029+ SMEAttrs FuncAttrs = MF.getInfo <AArch64FunctionInfo>()-> getSMEFnAttrs ( );
30303030 bool IsLocallyStreaming =
30313031 FuncAttrs.hasStreamingBody () && !FuncAttrs.hasStreamingInterface ();
30323032
@@ -3357,7 +3357,7 @@ bool AArch64FrameLowering::spillCalleeSavedRegisters(
33573357 // Find an available register to store value of VG to.
33583358 Reg1 = findScratchNonCalleeSaveRegister (&MBB);
33593359 assert (Reg1 != AArch64::NoRegister);
3360- SMEAttrs Attrs (MF. getFunction () );
3360+ SMEAttrs Attrs = AFI-> getSMEFnAttrs ( );
33613361
33623362 if (Attrs.hasStreamingBody () && !Attrs.hasStreamingInterface () &&
33633363 AFI->getStreamingVGIdx () == std::numeric_limits<int >::max ()) {
@@ -3686,12 +3686,13 @@ static std::optional<int> getLdStFrameID(const MachineInstr &MI,
36863686void AArch64FrameLowering::determineStackHazardSlot (
36873687 MachineFunction &MF, BitVector &SavedRegs) const {
36883688 unsigned StackHazardSize = getStackHazardSize (MF);
3689+ auto *AFI = MF.getInfo <AArch64FunctionInfo>();
36893690 if (StackHazardSize == 0 || StackHazardSize % 16 != 0 ||
3690- MF. getInfo <AArch64FunctionInfo>() ->hasStackHazardSlotIndex ())
3691+ AFI ->hasStackHazardSlotIndex ())
36913692 return ;
36923693
36933694 // Stack hazards are only needed in streaming functions.
3694- SMEAttrs Attrs (MF. getFunction () );
3695+ SMEAttrs Attrs = AFI-> getSMEFnAttrs ( );
36953696 if (!StackHazardInNonStreaming && Attrs.hasNonStreamingInterfaceAndBody ())
36963697 return ;
36973698
@@ -3728,7 +3729,7 @@ void AArch64FrameLowering::determineStackHazardSlot(
37283729 int ID = MFI.CreateStackObject (StackHazardSize, Align (16 ), false );
37293730 LLVM_DEBUG (dbgs () << " Created Hazard slot at " << ID << " size "
37303731 << StackHazardSize << " \n " );
3731- MF. getInfo <AArch64FunctionInfo>() ->setStackHazardSlotIndex (ID);
3732+ AFI ->setStackHazardSlotIndex (ID);
37323733 }
37333734}
37343735
@@ -3881,8 +3882,7 @@ void AArch64FrameLowering::determineCalleeSaves(MachineFunction &MF,
38813882 // changes, as we will need to spill the value of the VG register.
38823883 // For locally streaming functions, we spill both the streaming and
38833884 // non-streaming VG value.
3884- const Function &F = MF.getFunction ();
3885- SMEAttrs Attrs (F);
3885+ SMEAttrs Attrs = AFI->getSMEFnAttrs ();
38863886 if (requiresSaveVG (MF)) {
38873887 if (Attrs.hasStreamingBody () && !Attrs.hasStreamingInterface ())
38883888 CSStackSize += 16 ;
@@ -4039,7 +4039,7 @@ bool AArch64FrameLowering::assignCalleeSavedSpillSlots(
40394039 // Insert VG into the list of CSRs, immediately before LR if saved.
40404040 if (requiresSaveVG (MF)) {
40414041 std::vector<CalleeSavedInfo> VGSaves;
4042- SMEAttrs Attrs (MF. getFunction () );
4042+ SMEAttrs Attrs = AFI-> getSMEFnAttrs ( );
40434043
40444044 auto VGInfo = CalleeSavedInfo (AArch64::VG);
40454045 VGInfo.setRestored (false );
@@ -5056,10 +5056,10 @@ static void emitVGSaveRestore(MachineBasicBlock::iterator II,
50565056 MI.getOpcode () != AArch64::VGRestorePseudo)
50575057 return ;
50585058
5059- SMEAttrs FuncAttrs (MF->getFunction ());
5059+ auto *AFI = MF->getInfo <AArch64FunctionInfo>();
5060+ SMEAttrs FuncAttrs = AFI->getSMEFnAttrs ();
50605061 bool LocallyStreaming =
50615062 FuncAttrs.hasStreamingBody () && !FuncAttrs.hasStreamingInterface ();
5062- const AArch64FunctionInfo *AFI = MF->getInfo <AArch64FunctionInfo>();
50635063
50645064 int64_t VGFrameIdx =
50655065 LocallyStreaming ? AFI->getStreamingVGIdx () : AFI->getVGIdx ();
@@ -5549,8 +5549,8 @@ static inline raw_ostream &operator<<(raw_ostream &OS, const StackAccess &SA) {
55495549void AArch64FrameLowering::emitRemarks (
55505550 const MachineFunction &MF, MachineOptimizationRemarkEmitter *ORE) const {
55515551
5552- SMEAttrs Attrs ( MF.getFunction () );
5553- if (Attrs .hasNonStreamingInterfaceAndBody ())
5552+ auto *AFI = MF.getInfo <AArch64FunctionInfo>( );
5553+ if (AFI-> getSMEFnAttrs () .hasNonStreamingInterfaceAndBody ())
55545554 return ;
55555555
55565556 unsigned StackHazardSize = getStackHazardSize (MF);
0 commit comments