[llvm] r181979 - Don't call addFrameMove on XCore.
Rafael Espindola
rafael.espindola at gmail.com
Wed May 15 21:16:25 PDT 2013
Author: rafael
Date: Wed May 15 23:16:25 2013
New Revision: 181979
URL: http://llvm.org/viewvc/llvm-project?rev=181979&view=rev
Log:
Don't call addFrameMove on XCore.
getExceptionHandlingType is not ExceptionHandling::DwarfCFI on xcore, so
etFrameInstructions is never called. There is no point creating cfi
instructions if they are never used.
Modified:
llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp
Modified: llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp?rev=181979&r1=181978&r2=181979&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp Wed May 15 23:16:25 2013
@@ -136,16 +136,6 @@ void XCoreFrameLowering::emitPrologue(Ma
// Show update of SP.
MCSymbol *FrameLabel = MMI->getContext().CreateTempSymbol();
BuildMI(MBB, MBBI, dl, TII.get(XCore::PROLOG_LABEL)).addSym(FrameLabel);
-
- MachineLocation SPDst(MachineLocation::VirtualFP);
- MachineLocation SPSrc(MachineLocation::VirtualFP, -FrameSize * 4);
- MMI->addFrameMove(FrameLabel, SPDst, SPSrc);
-
- if (LRSavedOnEntry) {
- MachineLocation CSDst(MachineLocation::VirtualFP, 0);
- MachineLocation CSSrc(XCore::LR);
- MMI->addFrameMove(FrameLabel, CSDst, CSSrc);
- }
}
}
if (saveLR) {
@@ -156,9 +146,6 @@ void XCoreFrameLowering::emitPrologue(Ma
if (emitFrameMoves) {
MCSymbol *SaveLRLabel = MMI->getContext().CreateTempSymbol();
BuildMI(MBB, MBBI, dl, TII.get(XCore::PROLOG_LABEL)).addSym(SaveLRLabel);
- MachineLocation CSDst(MachineLocation::VirtualFP, LRSpillOffset);
- MachineLocation CSSrc(XCore::LR);
- MMI->addFrameMove(SaveLRLabel, CSDst, CSSrc);
}
}
@@ -171,9 +158,6 @@ void XCoreFrameLowering::emitPrologue(Ma
if (emitFrameMoves) {
MCSymbol *SaveR10Label = MMI->getContext().CreateTempSymbol();
BuildMI(MBB, MBBI, dl, TII.get(XCore::PROLOG_LABEL)).addSym(SaveR10Label);
- MachineLocation CSDst(MachineLocation::VirtualFP, FPSpillOffset);
- MachineLocation CSSrc(XCore::R10);
- MMI->addFrameMove(SaveR10Label, CSDst, CSSrc);
}
// Set the FP from the SP.
unsigned FramePtr = XCore::R10;
@@ -183,24 +167,6 @@ void XCoreFrameLowering::emitPrologue(Ma
// Show FP is now valid.
MCSymbol *FrameLabel = MMI->getContext().CreateTempSymbol();
BuildMI(MBB, MBBI, dl, TII.get(XCore::PROLOG_LABEL)).addSym(FrameLabel);
- MachineLocation SPDst(FramePtr);
- MachineLocation SPSrc(MachineLocation::VirtualFP);
- MMI->addFrameMove(FrameLabel, SPDst, SPSrc);
- }
- }
-
- if (emitFrameMoves) {
- // Frame moves for callee saved.
- std::vector<std::pair<MCSymbol*, CalleeSavedInfo> >&SpillLabels =
- XFI->getSpillLabels();
- for (unsigned I = 0, E = SpillLabels.size(); I != E; ++I) {
- MCSymbol *SpillLabel = SpillLabels[I].first;
- CalleeSavedInfo &CSI = SpillLabels[I].second;
- int Offset = MFI->getObjectOffset(CSI.getFrameIdx());
- unsigned Reg = CSI.getReg();
- MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
- MachineLocation CSSrc(Reg);
- MMI->addFrameMove(SpillLabel, CSDst, CSSrc);
}
}
}
More information about the llvm-commits
mailing list