for (unsigned I = 0, E = CSI.size(); I < E; ++I) {
if (CSI[I].getReg() == regsToMove[i]) {
// Subtract 8 to make room for R30 and R31, which are added above.
- int64_t Offset = getFrameIndexOffset(MF, CSI[I].getFrameIdx()) - 8;
+ unsigned FrameReg;
+ int64_t Offset =
+ getFrameIndexReference(MF, CSI[I].getFrameIdx(), FrameReg) - 8;
+
+ assert(FrameReg == HRI.getFrameRegister() &&
+ "FrameReg from getFrameIndexReference should be the default "
+ "frame reg");
if (regsToMove[i] < Hexagon::D0 || regsToMove[i] > Hexagon::D15) {
unsigned DwarfReg = HRI.getDwarfRegNum(regsToMove[i], true);
}
}
+int HexagonFrameLowering::getFrameIndexReference(const MachineFunction &MF,
+ int FI,
+ unsigned &FrameReg) const {
+ const TargetRegisterInfo *RI = MF.getSubtarget().getRegisterInfo();
+
+ // Fill in FrameReg output argument.
+ FrameReg = RI->getFrameRegister(MF);
-int HexagonFrameLowering::getFrameIndexOffset(const MachineFunction &MF,
- int FI) const {
return MF.getFrameInfo()->getObjectOffset(FI);
}
: SpillFuncThreshold;
return Threshold < NumCSI;
}
-