When setting up the frame pointer, add it as a live-in register to all

non-entry blocks, so that it doesn't appear use-before-def anywhere.

llvm-svn: 61214
This commit is contained in:
Dan Gohman 2008-12-18 22:01:52 +00:00
parent 0ab1144c79
commit 975f78ae79
1 changed files with 5 additions and 0 deletions

View File

@ -745,6 +745,11 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
BuildMI(MBB, MBBI, TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr), FramePtr)
.addReg(StackPtr);
// Mark the FramePtr as live-in in every block except the entry.
for (MachineFunction::iterator I = next(MF.begin()), E = MF.end();
I != E; ++I)
I->addLiveIn(FramePtr);
// Realign stack
if (needsStackRealignment(MF))
BuildMI(MBB, MBBI,