1f4a2713aSLionel Sambuc //===-- MSP430FrameLowering.cpp - MSP430 Frame Information ----------------===//
2f4a2713aSLionel Sambuc //
3f4a2713aSLionel Sambuc //                     The LLVM Compiler Infrastructure
4f4a2713aSLionel Sambuc //
5f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source
6f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details.
7f4a2713aSLionel Sambuc //
8f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
9f4a2713aSLionel Sambuc //
10f4a2713aSLionel Sambuc // This file contains the MSP430 implementation of TargetFrameLowering class.
11f4a2713aSLionel Sambuc //
12f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
13f4a2713aSLionel Sambuc 
14f4a2713aSLionel Sambuc #include "MSP430FrameLowering.h"
15f4a2713aSLionel Sambuc #include "MSP430InstrInfo.h"
16f4a2713aSLionel Sambuc #include "MSP430MachineFunctionInfo.h"
17*0a6a1f1dSLionel Sambuc #include "MSP430Subtarget.h"
18f4a2713aSLionel Sambuc #include "llvm/CodeGen/MachineFrameInfo.h"
19f4a2713aSLionel Sambuc #include "llvm/CodeGen/MachineFunction.h"
20f4a2713aSLionel Sambuc #include "llvm/CodeGen/MachineInstrBuilder.h"
21f4a2713aSLionel Sambuc #include "llvm/CodeGen/MachineModuleInfo.h"
22f4a2713aSLionel Sambuc #include "llvm/CodeGen/MachineRegisterInfo.h"
23f4a2713aSLionel Sambuc #include "llvm/IR/DataLayout.h"
24f4a2713aSLionel Sambuc #include "llvm/IR/Function.h"
25f4a2713aSLionel Sambuc #include "llvm/Support/CommandLine.h"
26f4a2713aSLionel Sambuc #include "llvm/Target/TargetOptions.h"
27f4a2713aSLionel Sambuc 
28f4a2713aSLionel Sambuc using namespace llvm;
29f4a2713aSLionel Sambuc 
hasFP(const MachineFunction & MF) const30f4a2713aSLionel Sambuc bool MSP430FrameLowering::hasFP(const MachineFunction &MF) const {
31f4a2713aSLionel Sambuc   const MachineFrameInfo *MFI = MF.getFrameInfo();
32f4a2713aSLionel Sambuc 
33f4a2713aSLionel Sambuc   return (MF.getTarget().Options.DisableFramePointerElim(MF) ||
34f4a2713aSLionel Sambuc           MF.getFrameInfo()->hasVarSizedObjects() ||
35f4a2713aSLionel Sambuc           MFI->isFrameAddressTaken());
36f4a2713aSLionel Sambuc }
37f4a2713aSLionel Sambuc 
hasReservedCallFrame(const MachineFunction & MF) const38f4a2713aSLionel Sambuc bool MSP430FrameLowering::hasReservedCallFrame(const MachineFunction &MF) const {
39f4a2713aSLionel Sambuc   return !MF.getFrameInfo()->hasVarSizedObjects();
40f4a2713aSLionel Sambuc }
41f4a2713aSLionel Sambuc 
emitPrologue(MachineFunction & MF) const42f4a2713aSLionel Sambuc void MSP430FrameLowering::emitPrologue(MachineFunction &MF) const {
43f4a2713aSLionel Sambuc   MachineBasicBlock &MBB = MF.front();   // Prolog goes in entry BB
44f4a2713aSLionel Sambuc   MachineFrameInfo *MFI = MF.getFrameInfo();
45f4a2713aSLionel Sambuc   MSP430MachineFunctionInfo *MSP430FI = MF.getInfo<MSP430MachineFunctionInfo>();
46f4a2713aSLionel Sambuc   const MSP430InstrInfo &TII =
47*0a6a1f1dSLionel Sambuc       *static_cast<const MSP430InstrInfo *>(MF.getSubtarget().getInstrInfo());
48f4a2713aSLionel Sambuc 
49f4a2713aSLionel Sambuc   MachineBasicBlock::iterator MBBI = MBB.begin();
50f4a2713aSLionel Sambuc   DebugLoc DL = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc();
51f4a2713aSLionel Sambuc 
52f4a2713aSLionel Sambuc   // Get the number of bytes to allocate from the FrameInfo.
53f4a2713aSLionel Sambuc   uint64_t StackSize = MFI->getStackSize();
54f4a2713aSLionel Sambuc 
55f4a2713aSLionel Sambuc   uint64_t NumBytes = 0;
56f4a2713aSLionel Sambuc   if (hasFP(MF)) {
57f4a2713aSLionel Sambuc     // Calculate required stack adjustment
58f4a2713aSLionel Sambuc     uint64_t FrameSize = StackSize - 2;
59f4a2713aSLionel Sambuc     NumBytes = FrameSize - MSP430FI->getCalleeSavedFrameSize();
60f4a2713aSLionel Sambuc 
61f4a2713aSLionel Sambuc     // Get the offset of the stack slot for the EBP register... which is
62f4a2713aSLionel Sambuc     // guaranteed to be the last slot by processFunctionBeforeFrameFinalized.
63f4a2713aSLionel Sambuc     // Update the frame offset adjustment.
64f4a2713aSLionel Sambuc     MFI->setOffsetAdjustment(-NumBytes);
65f4a2713aSLionel Sambuc 
66*0a6a1f1dSLionel Sambuc     // Save FP into the appropriate stack slot...
67f4a2713aSLionel Sambuc     BuildMI(MBB, MBBI, DL, TII.get(MSP430::PUSH16r))
68*0a6a1f1dSLionel Sambuc       .addReg(MSP430::FP, RegState::Kill);
69f4a2713aSLionel Sambuc 
70*0a6a1f1dSLionel Sambuc     // Update FP with the new base value...
71*0a6a1f1dSLionel Sambuc     BuildMI(MBB, MBBI, DL, TII.get(MSP430::MOV16rr), MSP430::FP)
72*0a6a1f1dSLionel Sambuc       .addReg(MSP430::SP);
73f4a2713aSLionel Sambuc 
74f4a2713aSLionel Sambuc     // Mark the FramePtr as live-in in every block except the entry.
75*0a6a1f1dSLionel Sambuc     for (MachineFunction::iterator I = std::next(MF.begin()), E = MF.end();
76f4a2713aSLionel Sambuc          I != E; ++I)
77*0a6a1f1dSLionel Sambuc       I->addLiveIn(MSP430::FP);
78f4a2713aSLionel Sambuc 
79f4a2713aSLionel Sambuc   } else
80f4a2713aSLionel Sambuc     NumBytes = StackSize - MSP430FI->getCalleeSavedFrameSize();
81f4a2713aSLionel Sambuc 
82f4a2713aSLionel Sambuc   // Skip the callee-saved push instructions.
83f4a2713aSLionel Sambuc   while (MBBI != MBB.end() && (MBBI->getOpcode() == MSP430::PUSH16r))
84f4a2713aSLionel Sambuc     ++MBBI;
85f4a2713aSLionel Sambuc 
86f4a2713aSLionel Sambuc   if (MBBI != MBB.end())
87f4a2713aSLionel Sambuc     DL = MBBI->getDebugLoc();
88f4a2713aSLionel Sambuc 
89*0a6a1f1dSLionel Sambuc   if (NumBytes) { // adjust stack pointer: SP -= numbytes
90*0a6a1f1dSLionel Sambuc     // If there is an SUB16ri of SP immediately before this instruction, merge
91f4a2713aSLionel Sambuc     // the two.
92f4a2713aSLionel Sambuc     //NumBytes -= mergeSPUpdates(MBB, MBBI, true);
93*0a6a1f1dSLionel Sambuc     // If there is an ADD16ri or SUB16ri of SP immediately after this
94f4a2713aSLionel Sambuc     // instruction, merge the two instructions.
95f4a2713aSLionel Sambuc     // mergeSPUpdatesDown(MBB, MBBI, &NumBytes);
96f4a2713aSLionel Sambuc 
97f4a2713aSLionel Sambuc     if (NumBytes) {
98f4a2713aSLionel Sambuc       MachineInstr *MI =
99*0a6a1f1dSLionel Sambuc         BuildMI(MBB, MBBI, DL, TII.get(MSP430::SUB16ri), MSP430::SP)
100*0a6a1f1dSLionel Sambuc         .addReg(MSP430::SP).addImm(NumBytes);
101f4a2713aSLionel Sambuc       // The SRW implicit def is dead.
102f4a2713aSLionel Sambuc       MI->getOperand(3).setIsDead();
103f4a2713aSLionel Sambuc     }
104f4a2713aSLionel Sambuc   }
105f4a2713aSLionel Sambuc }
106f4a2713aSLionel Sambuc 
emitEpilogue(MachineFunction & MF,MachineBasicBlock & MBB) const107f4a2713aSLionel Sambuc void MSP430FrameLowering::emitEpilogue(MachineFunction &MF,
108f4a2713aSLionel Sambuc                                        MachineBasicBlock &MBB) const {
109f4a2713aSLionel Sambuc   const MachineFrameInfo *MFI = MF.getFrameInfo();
110f4a2713aSLionel Sambuc   MSP430MachineFunctionInfo *MSP430FI = MF.getInfo<MSP430MachineFunctionInfo>();
111f4a2713aSLionel Sambuc   const MSP430InstrInfo &TII =
112*0a6a1f1dSLionel Sambuc       *static_cast<const MSP430InstrInfo *>(MF.getSubtarget().getInstrInfo());
113f4a2713aSLionel Sambuc 
114f4a2713aSLionel Sambuc   MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr();
115f4a2713aSLionel Sambuc   unsigned RetOpcode = MBBI->getOpcode();
116f4a2713aSLionel Sambuc   DebugLoc DL = MBBI->getDebugLoc();
117f4a2713aSLionel Sambuc 
118f4a2713aSLionel Sambuc   switch (RetOpcode) {
119f4a2713aSLionel Sambuc   case MSP430::RET:
120f4a2713aSLionel Sambuc   case MSP430::RETI: break;  // These are ok
121f4a2713aSLionel Sambuc   default:
122f4a2713aSLionel Sambuc     llvm_unreachable("Can only insert epilog into returning blocks");
123f4a2713aSLionel Sambuc   }
124f4a2713aSLionel Sambuc 
125f4a2713aSLionel Sambuc   // Get the number of bytes to allocate from the FrameInfo
126f4a2713aSLionel Sambuc   uint64_t StackSize = MFI->getStackSize();
127f4a2713aSLionel Sambuc   unsigned CSSize = MSP430FI->getCalleeSavedFrameSize();
128f4a2713aSLionel Sambuc   uint64_t NumBytes = 0;
129f4a2713aSLionel Sambuc 
130f4a2713aSLionel Sambuc   if (hasFP(MF)) {
131f4a2713aSLionel Sambuc     // Calculate required stack adjustment
132f4a2713aSLionel Sambuc     uint64_t FrameSize = StackSize - 2;
133f4a2713aSLionel Sambuc     NumBytes = FrameSize - CSSize;
134f4a2713aSLionel Sambuc 
135*0a6a1f1dSLionel Sambuc     // pop FP.
136*0a6a1f1dSLionel Sambuc     BuildMI(MBB, MBBI, DL, TII.get(MSP430::POP16r), MSP430::FP);
137f4a2713aSLionel Sambuc   } else
138f4a2713aSLionel Sambuc     NumBytes = StackSize - CSSize;
139f4a2713aSLionel Sambuc 
140f4a2713aSLionel Sambuc   // Skip the callee-saved pop instructions.
141f4a2713aSLionel Sambuc   while (MBBI != MBB.begin()) {
142*0a6a1f1dSLionel Sambuc     MachineBasicBlock::iterator PI = std::prev(MBBI);
143f4a2713aSLionel Sambuc     unsigned Opc = PI->getOpcode();
144f4a2713aSLionel Sambuc     if (Opc != MSP430::POP16r && !PI->isTerminator())
145f4a2713aSLionel Sambuc       break;
146f4a2713aSLionel Sambuc     --MBBI;
147f4a2713aSLionel Sambuc   }
148f4a2713aSLionel Sambuc 
149f4a2713aSLionel Sambuc   DL = MBBI->getDebugLoc();
150f4a2713aSLionel Sambuc 
151*0a6a1f1dSLionel Sambuc   // If there is an ADD16ri or SUB16ri of SP immediately before this
152f4a2713aSLionel Sambuc   // instruction, merge the two instructions.
153f4a2713aSLionel Sambuc   //if (NumBytes || MFI->hasVarSizedObjects())
154f4a2713aSLionel Sambuc   //  mergeSPUpdatesUp(MBB, MBBI, StackPtr, &NumBytes);
155f4a2713aSLionel Sambuc 
156f4a2713aSLionel Sambuc   if (MFI->hasVarSizedObjects()) {
157f4a2713aSLionel Sambuc     BuildMI(MBB, MBBI, DL,
158*0a6a1f1dSLionel Sambuc             TII.get(MSP430::MOV16rr), MSP430::SP).addReg(MSP430::FP);
159f4a2713aSLionel Sambuc     if (CSSize) {
160f4a2713aSLionel Sambuc       MachineInstr *MI =
161f4a2713aSLionel Sambuc         BuildMI(MBB, MBBI, DL,
162*0a6a1f1dSLionel Sambuc                 TII.get(MSP430::SUB16ri), MSP430::SP)
163*0a6a1f1dSLionel Sambuc         .addReg(MSP430::SP).addImm(CSSize);
164f4a2713aSLionel Sambuc       // The SRW implicit def is dead.
165f4a2713aSLionel Sambuc       MI->getOperand(3).setIsDead();
166f4a2713aSLionel Sambuc     }
167f4a2713aSLionel Sambuc   } else {
168*0a6a1f1dSLionel Sambuc     // adjust stack pointer back: SP += numbytes
169f4a2713aSLionel Sambuc     if (NumBytes) {
170f4a2713aSLionel Sambuc       MachineInstr *MI =
171*0a6a1f1dSLionel Sambuc         BuildMI(MBB, MBBI, DL, TII.get(MSP430::ADD16ri), MSP430::SP)
172*0a6a1f1dSLionel Sambuc         .addReg(MSP430::SP).addImm(NumBytes);
173f4a2713aSLionel Sambuc       // The SRW implicit def is dead.
174f4a2713aSLionel Sambuc       MI->getOperand(3).setIsDead();
175f4a2713aSLionel Sambuc     }
176f4a2713aSLionel Sambuc   }
177f4a2713aSLionel Sambuc }
178f4a2713aSLionel Sambuc 
179f4a2713aSLionel Sambuc // FIXME: Can we eleminate these in favour of generic code?
180f4a2713aSLionel Sambuc bool
spillCalleeSavedRegisters(MachineBasicBlock & MBB,MachineBasicBlock::iterator MI,const std::vector<CalleeSavedInfo> & CSI,const TargetRegisterInfo * TRI) const181f4a2713aSLionel Sambuc MSP430FrameLowering::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
182f4a2713aSLionel Sambuc                                            MachineBasicBlock::iterator MI,
183f4a2713aSLionel Sambuc                                         const std::vector<CalleeSavedInfo> &CSI,
184f4a2713aSLionel Sambuc                                         const TargetRegisterInfo *TRI) const {
185f4a2713aSLionel Sambuc   if (CSI.empty())
186f4a2713aSLionel Sambuc     return false;
187f4a2713aSLionel Sambuc 
188f4a2713aSLionel Sambuc   DebugLoc DL;
189f4a2713aSLionel Sambuc   if (MI != MBB.end()) DL = MI->getDebugLoc();
190f4a2713aSLionel Sambuc 
191f4a2713aSLionel Sambuc   MachineFunction &MF = *MBB.getParent();
192*0a6a1f1dSLionel Sambuc   const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
193f4a2713aSLionel Sambuc   MSP430MachineFunctionInfo *MFI = MF.getInfo<MSP430MachineFunctionInfo>();
194f4a2713aSLionel Sambuc   MFI->setCalleeSavedFrameSize(CSI.size() * 2);
195f4a2713aSLionel Sambuc 
196f4a2713aSLionel Sambuc   for (unsigned i = CSI.size(); i != 0; --i) {
197f4a2713aSLionel Sambuc     unsigned Reg = CSI[i-1].getReg();
198f4a2713aSLionel Sambuc     // Add the callee-saved register as live-in. It's killed at the spill.
199f4a2713aSLionel Sambuc     MBB.addLiveIn(Reg);
200f4a2713aSLionel Sambuc     BuildMI(MBB, MI, DL, TII.get(MSP430::PUSH16r))
201f4a2713aSLionel Sambuc       .addReg(Reg, RegState::Kill);
202f4a2713aSLionel Sambuc   }
203f4a2713aSLionel Sambuc   return true;
204f4a2713aSLionel Sambuc }
205f4a2713aSLionel Sambuc 
206f4a2713aSLionel Sambuc bool
restoreCalleeSavedRegisters(MachineBasicBlock & MBB,MachineBasicBlock::iterator MI,const std::vector<CalleeSavedInfo> & CSI,const TargetRegisterInfo * TRI) const207f4a2713aSLionel Sambuc MSP430FrameLowering::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
208f4a2713aSLionel Sambuc                                                  MachineBasicBlock::iterator MI,
209f4a2713aSLionel Sambuc                                         const std::vector<CalleeSavedInfo> &CSI,
210f4a2713aSLionel Sambuc                                         const TargetRegisterInfo *TRI) const {
211f4a2713aSLionel Sambuc   if (CSI.empty())
212f4a2713aSLionel Sambuc     return false;
213f4a2713aSLionel Sambuc 
214f4a2713aSLionel Sambuc   DebugLoc DL;
215f4a2713aSLionel Sambuc   if (MI != MBB.end()) DL = MI->getDebugLoc();
216f4a2713aSLionel Sambuc 
217f4a2713aSLionel Sambuc   MachineFunction &MF = *MBB.getParent();
218*0a6a1f1dSLionel Sambuc   const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
219f4a2713aSLionel Sambuc 
220f4a2713aSLionel Sambuc   for (unsigned i = 0, e = CSI.size(); i != e; ++i)
221f4a2713aSLionel Sambuc     BuildMI(MBB, MI, DL, TII.get(MSP430::POP16r), CSI[i].getReg());
222f4a2713aSLionel Sambuc 
223f4a2713aSLionel Sambuc   return true;
224f4a2713aSLionel Sambuc }
225f4a2713aSLionel Sambuc 
226f4a2713aSLionel Sambuc void MSP430FrameLowering::
eliminateCallFramePseudoInstr(MachineFunction & MF,MachineBasicBlock & MBB,MachineBasicBlock::iterator I) const227f4a2713aSLionel Sambuc eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
228f4a2713aSLionel Sambuc                               MachineBasicBlock::iterator I) const {
229f4a2713aSLionel Sambuc   const MSP430InstrInfo &TII =
230*0a6a1f1dSLionel Sambuc       *static_cast<const MSP430InstrInfo *>(MF.getSubtarget().getInstrInfo());
231f4a2713aSLionel Sambuc   unsigned StackAlign = getStackAlignment();
232f4a2713aSLionel Sambuc 
233f4a2713aSLionel Sambuc   if (!hasReservedCallFrame(MF)) {
234f4a2713aSLionel Sambuc     // If the stack pointer can be changed after prologue, turn the
235*0a6a1f1dSLionel Sambuc     // adjcallstackup instruction into a 'sub SP, <amt>' and the
236*0a6a1f1dSLionel Sambuc     // adjcallstackdown instruction into 'add SP, <amt>'
237f4a2713aSLionel Sambuc     // TODO: consider using push / pop instead of sub + store / add
238f4a2713aSLionel Sambuc     MachineInstr *Old = I;
239f4a2713aSLionel Sambuc     uint64_t Amount = Old->getOperand(0).getImm();
240f4a2713aSLionel Sambuc     if (Amount != 0) {
241f4a2713aSLionel Sambuc       // We need to keep the stack aligned properly.  To do this, we round the
242f4a2713aSLionel Sambuc       // amount of space needed for the outgoing arguments up to the next
243f4a2713aSLionel Sambuc       // alignment boundary.
244f4a2713aSLionel Sambuc       Amount = (Amount+StackAlign-1)/StackAlign*StackAlign;
245f4a2713aSLionel Sambuc 
246*0a6a1f1dSLionel Sambuc       MachineInstr *New = nullptr;
247f4a2713aSLionel Sambuc       if (Old->getOpcode() == TII.getCallFrameSetupOpcode()) {
248f4a2713aSLionel Sambuc         New = BuildMI(MF, Old->getDebugLoc(),
249*0a6a1f1dSLionel Sambuc                       TII.get(MSP430::SUB16ri), MSP430::SP)
250*0a6a1f1dSLionel Sambuc           .addReg(MSP430::SP).addImm(Amount);
251f4a2713aSLionel Sambuc       } else {
252f4a2713aSLionel Sambuc         assert(Old->getOpcode() == TII.getCallFrameDestroyOpcode());
253f4a2713aSLionel Sambuc         // factor out the amount the callee already popped.
254f4a2713aSLionel Sambuc         uint64_t CalleeAmt = Old->getOperand(1).getImm();
255f4a2713aSLionel Sambuc         Amount -= CalleeAmt;
256f4a2713aSLionel Sambuc         if (Amount)
257f4a2713aSLionel Sambuc           New = BuildMI(MF, Old->getDebugLoc(),
258*0a6a1f1dSLionel Sambuc                         TII.get(MSP430::ADD16ri), MSP430::SP)
259*0a6a1f1dSLionel Sambuc             .addReg(MSP430::SP).addImm(Amount);
260f4a2713aSLionel Sambuc       }
261f4a2713aSLionel Sambuc 
262f4a2713aSLionel Sambuc       if (New) {
263f4a2713aSLionel Sambuc         // The SRW implicit def is dead.
264f4a2713aSLionel Sambuc         New->getOperand(3).setIsDead();
265f4a2713aSLionel Sambuc 
266f4a2713aSLionel Sambuc         // Replace the pseudo instruction with a new instruction...
267f4a2713aSLionel Sambuc         MBB.insert(I, New);
268f4a2713aSLionel Sambuc       }
269f4a2713aSLionel Sambuc     }
270f4a2713aSLionel Sambuc   } else if (I->getOpcode() == TII.getCallFrameDestroyOpcode()) {
271f4a2713aSLionel Sambuc     // If we are performing frame pointer elimination and if the callee pops
272f4a2713aSLionel Sambuc     // something off the stack pointer, add it back.
273f4a2713aSLionel Sambuc     if (uint64_t CalleeAmt = I->getOperand(1).getImm()) {
274f4a2713aSLionel Sambuc       MachineInstr *Old = I;
275f4a2713aSLionel Sambuc       MachineInstr *New =
276f4a2713aSLionel Sambuc         BuildMI(MF, Old->getDebugLoc(), TII.get(MSP430::SUB16ri),
277*0a6a1f1dSLionel Sambuc                 MSP430::SP).addReg(MSP430::SP).addImm(CalleeAmt);
278f4a2713aSLionel Sambuc       // The SRW implicit def is dead.
279f4a2713aSLionel Sambuc       New->getOperand(3).setIsDead();
280f4a2713aSLionel Sambuc 
281f4a2713aSLionel Sambuc       MBB.insert(I, New);
282f4a2713aSLionel Sambuc     }
283f4a2713aSLionel Sambuc   }
284f4a2713aSLionel Sambuc 
285f4a2713aSLionel Sambuc   MBB.erase(I);
286f4a2713aSLionel Sambuc }
287f4a2713aSLionel Sambuc 
288f4a2713aSLionel Sambuc void
processFunctionBeforeFrameFinalized(MachineFunction & MF,RegScavenger *) const289f4a2713aSLionel Sambuc MSP430FrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF,
290f4a2713aSLionel Sambuc                                                          RegScavenger *) const {
291*0a6a1f1dSLionel Sambuc   // Create a frame entry for the FP register that must be saved.
292f4a2713aSLionel Sambuc   if (hasFP(MF)) {
293f4a2713aSLionel Sambuc     int FrameIdx = MF.getFrameInfo()->CreateFixedObject(2, -4, true);
294f4a2713aSLionel Sambuc     (void)FrameIdx;
295f4a2713aSLionel Sambuc     assert(FrameIdx == MF.getFrameInfo()->getObjectIndexBegin() &&
296*0a6a1f1dSLionel Sambuc            "Slot for FP register must be last in order to be found!");
297f4a2713aSLionel Sambuc   }
298f4a2713aSLionel Sambuc }
299