@@ -640,7 +640,7 @@ void RISCVFrameLowering::emitPrologue(MachineFunction &MF,
640
640
// directives.
641
641
for (const auto &Entry : CSI) {
642
642
int FrameIdx = Entry.getFrameIdx ();
643
- if (FrameIdx >=0 &&
643
+ if (FrameIdx >= 0 &&
644
644
MFI.getStackID (FrameIdx) == TargetStackID::ScalableVector)
645
645
continue ;
646
646
@@ -1651,37 +1651,11 @@ bool RISCVFrameLowering::restoreCalleeSavedRegisters(
1651
1651
DL = MI->getDebugLoc ();
1652
1652
1653
1653
// Manually restore values not restored by libcall & Push/Pop.
1654
- // Keep the same order as in the prologue. There is no need to reverse the
1655
- // order in the epilogue. In addition, the return address will be restored
1656
- // first in the epilogue. It increases the opportunity to avoid the
1657
- // load-to-use data hazard between loading RA and return by RA.
1658
- // loadRegFromStackSlot can insert multiple instructions.
1659
- //
1660
- //
1661
- // We first change the restore order for scalar and vector
1662
- // callee-saved registers as the layout shown below:
1663
- //
1664
- // Epilog restore order (original):
1665
- // ----------------------------
1666
- // RVV objects
1667
- // ----------------------------
1668
- // Callee-saved regs(scalar)
1669
- // Callee-saved regs(vector)
1670
- // ----------------------------
1671
- //
1672
- // Epilog restore order (after):
1673
- // ----------------------------
1674
- // RVV objects
1675
- // ----------------------------
1676
- // Callee-saved regs(vector)
1677
- // Callee-saved regs(scalar)
1678
- // ----------------------------
1679
- //
1680
- // So that it is able to put all vector registers which need
1681
- // to be restored together. The return address will be restored
1682
- // first in the scalar regs. It increases the opportunity to avoid the
1683
- // load-to-use data hazard between loading RA and return by RA.
1684
- // loadRegFromStackSlot can insert multiple instructions.
1654
+ // Reverse the restore order in epilog. In addition, the return
1655
+ // address will be restored first in the epilogue. It increases
1656
+ // the opportunity to avoid the load-to-use data hazard between
1657
+ // loading RA and return by RA. loadRegFromStackSlot can insert
1658
+ // multiple instructions.
1685
1659
const auto &UnmanagedCSI = getUnmanagedCSI (*MF, CSI);
1686
1660
const auto &RVVCSI = getRVVCalleeSavedInfo (*MF, CSI);
1687
1661
0 commit comments