From 975f78ae79d56e8cb8285f00fdf829f3a094ee09 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 18 Dec 2008 22:01:52 +0000 Subject: [PATCH] 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 --- llvm/lib/Target/X86/X86RegisterInfo.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp index 4bdfd8c101d9..4f4a33db74bb 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.cpp +++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp @@ -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,