[Stackmap] Liveness Analysis Pass
[oota-llvm.git] / include / llvm / CodeGen / MachineFrameInfo.h
1 //===-- CodeGen/MachineFrameInfo.h - Abstract Stack Frame Rep. --*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // The file defines the MachineFrameInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_CODEGEN_MACHINEFRAMEINFO_H
15 #define LLVM_CODEGEN_MACHINEFRAMEINFO_H
16
17 #include "llvm/ADT/SmallVector.h"
18 #include "llvm/Support/DataTypes.h"
19 #include <cassert>
20 #include <vector>
21
22 namespace llvm {
23 class raw_ostream;
24 class DataLayout;
25 class TargetRegisterClass;
26 class Type;
27 class MachineFunction;
28 class MachineBasicBlock;
29 class TargetFrameLowering;
30 class TargetMachine;
31 class BitVector;
32 class Value;
33 class AllocaInst;
34
35 /// The CalleeSavedInfo class tracks the information need to locate where a
36 /// callee saved register is in the current frame.
37 class CalleeSavedInfo {
38   unsigned Reg;
39   int FrameIdx;
40
41 public:
42   explicit CalleeSavedInfo(unsigned R, int FI = 0)
43   : Reg(R), FrameIdx(FI) {}
44
45   // Accessors.
46   unsigned getReg()                        const { return Reg; }
47   int getFrameIdx()                        const { return FrameIdx; }
48   void setFrameIdx(int FI)                       { FrameIdx = FI; }
49 };
50
51 /// The MachineFrameInfo class represents an abstract stack frame until
52 /// prolog/epilog code is inserted.  This class is key to allowing stack frame
53 /// representation optimizations, such as frame pointer elimination.  It also
54 /// allows more mundane (but still important) optimizations, such as reordering
55 /// of abstract objects on the stack frame.
56 ///
57 /// To support this, the class assigns unique integer identifiers to stack
58 /// objects requested clients.  These identifiers are negative integers for
59 /// fixed stack objects (such as arguments passed on the stack) or nonnegative
60 /// for objects that may be reordered.  Instructions which refer to stack
61 /// objects use a special MO_FrameIndex operand to represent these frame
62 /// indexes.
63 ///
64 /// Because this class keeps track of all references to the stack frame, it
65 /// knows when a variable sized object is allocated on the stack.  This is the
66 /// sole condition which prevents frame pointer elimination, which is an
67 /// important optimization on register-poor architectures.  Because original
68 /// variable sized alloca's in the source program are the only source of
69 /// variable sized stack objects, it is safe to decide whether there will be
70 /// any variable sized objects before all stack objects are known (for
71 /// example, register allocator spill code never needs variable sized
72 /// objects).
73 ///
74 /// When prolog/epilog code emission is performed, the final stack frame is
75 /// built and the machine instructions are modified to refer to the actual
76 /// stack offsets of the object, eliminating all MO_FrameIndex operands from
77 /// the program.
78 ///
79 /// @brief Abstract Stack Frame Information
80 class MachineFrameInfo {
81
82   // StackObject - Represent a single object allocated on the stack.
83   struct StackObject {
84     // SPOffset - The offset of this object from the stack pointer on entry to
85     // the function.  This field has no meaning for a variable sized element.
86     int64_t SPOffset;
87
88     // The size of this object on the stack. 0 means a variable sized object,
89     // ~0ULL means a dead object.
90     uint64_t Size;
91
92     // Alignment - The required alignment of this stack slot.
93     unsigned Alignment;
94
95     // isImmutable - If true, the value of the stack object is set before
96     // entering the function and is not modified inside the function. By
97     // default, fixed objects are immutable unless marked otherwise.
98     bool isImmutable;
99
100     // isSpillSlot - If true the stack object is used as spill slot. It
101     // cannot alias any other memory objects.
102     bool isSpillSlot;
103
104     // MayNeedSP - If true the stack object triggered the creation of the stack
105     // protector. We should allocate this object right after the stack
106     // protector.
107     bool MayNeedSP;
108
109     /// Alloca - If this stack object is originated from an Alloca instruction
110     /// this value saves the original IR allocation. Can be NULL.
111     const AllocaInst *Alloca;
112
113     // PreAllocated - If true, the object was mapped into the local frame
114     // block and doesn't need additional handling for allocation beyond that.
115     bool PreAllocated;
116
117     StackObject(uint64_t Sz, unsigned Al, int64_t SP, bool IM,
118                 bool isSS, bool NSP, const AllocaInst *Val)
119       : SPOffset(SP), Size(Sz), Alignment(Al), isImmutable(IM),
120         isSpillSlot(isSS), MayNeedSP(NSP), Alloca(Val), PreAllocated(false) {}
121   };
122
123   const TargetMachine &TM;
124
125   /// Objects - The list of stack objects allocated...
126   ///
127   std::vector<StackObject> Objects;
128
129   /// NumFixedObjects - This contains the number of fixed objects contained on
130   /// the stack.  Because fixed objects are stored at a negative index in the
131   /// Objects list, this is also the index to the 0th object in the list.
132   ///
133   unsigned NumFixedObjects;
134
135   /// HasVarSizedObjects - This boolean keeps track of whether any variable
136   /// sized objects have been allocated yet.
137   ///
138   bool HasVarSizedObjects;
139
140   /// FrameAddressTaken - This boolean keeps track of whether there is a call
141   /// to builtin \@llvm.frameaddress.
142   bool FrameAddressTaken;
143
144   /// ReturnAddressTaken - This boolean keeps track of whether there is a call
145   /// to builtin \@llvm.returnaddress.
146   bool ReturnAddressTaken;
147
148   /// HasStackMap - This boolean keeps track of whether there is a call
149   /// to builtin \@llvm.experimental.stackmap.
150   bool HasStackMap;
151
152   /// HasPatchPoint - This boolean keeps track of whether there is a call
153   /// to builtin \@llvm.experimental.patchpoint.
154   bool HasPatchPoint;
155
156   /// StackSize - The prolog/epilog code inserter calculates the final stack
157   /// offsets for all of the fixed size objects, updating the Objects list
158   /// above.  It then updates StackSize to contain the number of bytes that need
159   /// to be allocated on entry to the function.
160   ///
161   uint64_t StackSize;
162
163   /// OffsetAdjustment - The amount that a frame offset needs to be adjusted to
164   /// have the actual offset from the stack/frame pointer.  The exact usage of
165   /// this is target-dependent, but it is typically used to adjust between
166   /// SP-relative and FP-relative offsets.  E.G., if objects are accessed via
167   /// SP then OffsetAdjustment is zero; if FP is used, OffsetAdjustment is set
168   /// to the distance between the initial SP and the value in FP.  For many
169   /// targets, this value is only used when generating debug info (via
170   /// TargetRegisterInfo::getFrameIndexOffset); when generating code, the
171   /// corresponding adjustments are performed directly.
172   int OffsetAdjustment;
173
174   /// MaxAlignment - The prolog/epilog code inserter may process objects
175   /// that require greater alignment than the default alignment the target
176   /// provides. To handle this, MaxAlignment is set to the maximum alignment
177   /// needed by the objects on the current frame.  If this is greater than the
178   /// native alignment maintained by the compiler, dynamic alignment code will
179   /// be needed.
180   ///
181   unsigned MaxAlignment;
182
183   /// AdjustsStack - Set to true if this function adjusts the stack -- e.g.,
184   /// when calling another function. This is only valid during and after
185   /// prolog/epilog code insertion.
186   bool AdjustsStack;
187
188   /// HasCalls - Set to true if this function has any function calls.
189   bool HasCalls;
190
191   /// StackProtectorIdx - The frame index for the stack protector.
192   int StackProtectorIdx;
193
194   /// FunctionContextIdx - The frame index for the function context. Used for
195   /// SjLj exceptions.
196   int FunctionContextIdx;
197
198   /// MaxCallFrameSize - This contains the size of the largest call frame if the
199   /// target uses frame setup/destroy pseudo instructions (as defined in the
200   /// TargetFrameInfo class).  This information is important for frame pointer
201   /// elimination.  If is only valid during and after prolog/epilog code
202   /// insertion.
203   ///
204   unsigned MaxCallFrameSize;
205
206   /// CSInfo - The prolog/epilog code inserter fills in this vector with each
207   /// callee saved register saved in the frame.  Beyond its use by the prolog/
208   /// epilog code inserter, this data used for debug info and exception
209   /// handling.
210   std::vector<CalleeSavedInfo> CSInfo;
211
212   /// CSIValid - Has CSInfo been set yet?
213   bool CSIValid;
214
215   /// LocalFrameObjects - References to frame indices which are mapped
216   /// into the local frame allocation block. <FrameIdx, LocalOffset>
217   SmallVector<std::pair<int, int64_t>, 32> LocalFrameObjects;
218
219   /// LocalFrameSize - Size of the pre-allocated local frame block.
220   int64_t LocalFrameSize;
221
222   /// Required alignment of the local object blob, which is the strictest
223   /// alignment of any object in it.
224   unsigned LocalFrameMaxAlign;
225
226   /// Whether the local object blob needs to be allocated together. If not,
227   /// PEI should ignore the isPreAllocated flags on the stack objects and
228   /// just allocate them normally.
229   bool UseLocalStackAllocationBlock;
230
231   /// Whether the "realign-stack" option is on.
232   bool RealignOption;
233
234   /// True if the function includes inline assembly that adjusts the stack
235   /// pointer.
236   bool HasInlineAsmWithSPAdjust;
237
238   const TargetFrameLowering *getFrameLowering() const;
239 public:
240     explicit MachineFrameInfo(const TargetMachine &TM, bool RealignOpt)
241     : TM(TM), RealignOption(RealignOpt) {
242     StackSize = NumFixedObjects = OffsetAdjustment = MaxAlignment = 0;
243     HasVarSizedObjects = false;
244     FrameAddressTaken = false;
245     ReturnAddressTaken = false;
246     HasStackMap = false;
247     HasPatchPoint = false;
248     AdjustsStack = false;
249     HasCalls = false;
250     StackProtectorIdx = -1;
251     FunctionContextIdx = -1;
252     MaxCallFrameSize = 0;
253     CSIValid = false;
254     LocalFrameSize = 0;
255     LocalFrameMaxAlign = 0;
256     UseLocalStackAllocationBlock = false;
257   }
258
259   /// hasStackObjects - Return true if there are any stack objects in this
260   /// function.
261   ///
262   bool hasStackObjects() const { return !Objects.empty(); }
263
264   /// hasVarSizedObjects - This method may be called any time after instruction
265   /// selection is complete to determine if the stack frame for this function
266   /// contains any variable sized objects.
267   ///
268   bool hasVarSizedObjects() const { return HasVarSizedObjects; }
269
270   /// getStackProtectorIndex/setStackProtectorIndex - Return the index for the
271   /// stack protector object.
272   ///
273   int getStackProtectorIndex() const { return StackProtectorIdx; }
274   void setStackProtectorIndex(int I) { StackProtectorIdx = I; }
275
276   /// getFunctionContextIndex/setFunctionContextIndex - Return the index for the
277   /// function context object. This object is used for SjLj exceptions.
278   int getFunctionContextIndex() const { return FunctionContextIdx; }
279   void setFunctionContextIndex(int I) { FunctionContextIdx = I; }
280
281   /// isFrameAddressTaken - This method may be called any time after instruction
282   /// selection is complete to determine if there is a call to
283   /// \@llvm.frameaddress in this function.
284   bool isFrameAddressTaken() const { return FrameAddressTaken; }
285   void setFrameAddressIsTaken(bool T) { FrameAddressTaken = T; }
286
287   /// isReturnAddressTaken - This method may be called any time after
288   /// instruction selection is complete to determine if there is a call to
289   /// \@llvm.returnaddress in this function.
290   bool isReturnAddressTaken() const { return ReturnAddressTaken; }
291   void setReturnAddressIsTaken(bool s) { ReturnAddressTaken = s; }
292
293   /// hasStackMap - This method may be called any time after instruction
294   /// selection is complete to determine if there is a call to builtin
295   /// \@llvm.experimental.stackmap.
296   bool hasStackMap() const { return HasStackMap; }
297   void setHasStackMap(bool s = true) { HasStackMap = s; }
298
299   /// hasPatchPoint - This method may be called any time after instruction
300   /// selection is complete to determine if there is a call to builtin
301   /// \@llvm.experimental.patchpoint.
302   bool hasPatchPoint() const { return HasPatchPoint; }
303   void setHasPatchPoint(bool s = true) { HasPatchPoint = s; }
304
305   /// getObjectIndexBegin - Return the minimum frame object index.
306   ///
307   int getObjectIndexBegin() const { return -NumFixedObjects; }
308
309   /// getObjectIndexEnd - Return one past the maximum frame object index.
310   ///
311   int getObjectIndexEnd() const { return (int)Objects.size()-NumFixedObjects; }
312
313   /// getNumFixedObjects - Return the number of fixed objects.
314   unsigned getNumFixedObjects() const { return NumFixedObjects; }
315
316   /// getNumObjects - Return the number of objects.
317   ///
318   unsigned getNumObjects() const { return Objects.size(); }
319
320   /// mapLocalFrameObject - Map a frame index into the local object block
321   void mapLocalFrameObject(int ObjectIndex, int64_t Offset) {
322     LocalFrameObjects.push_back(std::pair<int, int64_t>(ObjectIndex, Offset));
323     Objects[ObjectIndex + NumFixedObjects].PreAllocated = true;
324   }
325
326   /// getLocalFrameObjectMap - Get the local offset mapping for a for an object
327   std::pair<int, int64_t> getLocalFrameObjectMap(int i) {
328     assert (i >= 0 && (unsigned)i < LocalFrameObjects.size() &&
329             "Invalid local object reference!");
330     return LocalFrameObjects[i];
331   }
332
333   /// getLocalFrameObjectCount - Return the number of objects allocated into
334   /// the local object block.
335   int64_t getLocalFrameObjectCount() { return LocalFrameObjects.size(); }
336
337   /// setLocalFrameSize - Set the size of the local object blob.
338   void setLocalFrameSize(int64_t sz) { LocalFrameSize = sz; }
339
340   /// getLocalFrameSize - Get the size of the local object blob.
341   int64_t getLocalFrameSize() const { return LocalFrameSize; }
342
343   /// setLocalFrameMaxAlign - Required alignment of the local object blob,
344   /// which is the strictest alignment of any object in it.
345   void setLocalFrameMaxAlign(unsigned Align) { LocalFrameMaxAlign = Align; }
346
347   /// getLocalFrameMaxAlign - Return the required alignment of the local
348   /// object blob.
349   unsigned getLocalFrameMaxAlign() const { return LocalFrameMaxAlign; }
350
351   /// getUseLocalStackAllocationBlock - Get whether the local allocation blob
352   /// should be allocated together or let PEI allocate the locals in it
353   /// directly.
354   bool getUseLocalStackAllocationBlock() {return UseLocalStackAllocationBlock;}
355
356   /// setUseLocalStackAllocationBlock - Set whether the local allocation blob
357   /// should be allocated together or let PEI allocate the locals in it
358   /// directly.
359   void setUseLocalStackAllocationBlock(bool v) {
360     UseLocalStackAllocationBlock = v;
361   }
362
363   /// isObjectPreAllocated - Return true if the object was pre-allocated into
364   /// the local block.
365   bool isObjectPreAllocated(int ObjectIdx) const {
366     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
367            "Invalid Object Idx!");
368     return Objects[ObjectIdx+NumFixedObjects].PreAllocated;
369   }
370
371   /// getObjectSize - Return the size of the specified object.
372   ///
373   int64_t getObjectSize(int ObjectIdx) const {
374     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
375            "Invalid Object Idx!");
376     return Objects[ObjectIdx+NumFixedObjects].Size;
377   }
378
379   /// setObjectSize - Change the size of the specified stack object.
380   void setObjectSize(int ObjectIdx, int64_t Size) {
381     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
382            "Invalid Object Idx!");
383     Objects[ObjectIdx+NumFixedObjects].Size = Size;
384   }
385
386   /// getObjectAlignment - Return the alignment of the specified stack object.
387   unsigned getObjectAlignment(int ObjectIdx) const {
388     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
389            "Invalid Object Idx!");
390     return Objects[ObjectIdx+NumFixedObjects].Alignment;
391   }
392
393   /// setObjectAlignment - Change the alignment of the specified stack object.
394   void setObjectAlignment(int ObjectIdx, unsigned Align) {
395     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
396            "Invalid Object Idx!");
397     Objects[ObjectIdx+NumFixedObjects].Alignment = Align;
398     ensureMaxAlignment(Align);
399   }
400
401   /// getObjectAllocation - Return the underlying Alloca of the specified
402   /// stack object if it exists. Returns 0 if none exists.
403   const AllocaInst* getObjectAllocation(int ObjectIdx) const {
404     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
405            "Invalid Object Idx!");
406     return Objects[ObjectIdx+NumFixedObjects].Alloca;
407   }
408
409   /// NeedsStackProtector - Returns true if the object may need stack
410   /// protectors.
411   bool MayNeedStackProtector(int ObjectIdx) const {
412     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
413            "Invalid Object Idx!");
414     return Objects[ObjectIdx+NumFixedObjects].MayNeedSP;
415   }
416
417   /// getObjectOffset - Return the assigned stack offset of the specified object
418   /// from the incoming stack pointer.
419   ///
420   int64_t getObjectOffset(int ObjectIdx) const {
421     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
422            "Invalid Object Idx!");
423     assert(!isDeadObjectIndex(ObjectIdx) &&
424            "Getting frame offset for a dead object?");
425     return Objects[ObjectIdx+NumFixedObjects].SPOffset;
426   }
427
428   /// setObjectOffset - Set the stack frame offset of the specified object.  The
429   /// offset is relative to the stack pointer on entry to the function.
430   ///
431   void setObjectOffset(int ObjectIdx, int64_t SPOffset) {
432     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
433            "Invalid Object Idx!");
434     assert(!isDeadObjectIndex(ObjectIdx) &&
435            "Setting frame offset for a dead object?");
436     Objects[ObjectIdx+NumFixedObjects].SPOffset = SPOffset;
437   }
438
439   /// getStackSize - Return the number of bytes that must be allocated to hold
440   /// all of the fixed size frame objects.  This is only valid after
441   /// Prolog/Epilog code insertion has finalized the stack frame layout.
442   ///
443   uint64_t getStackSize() const { return StackSize; }
444
445   /// setStackSize - Set the size of the stack...
446   ///
447   void setStackSize(uint64_t Size) { StackSize = Size; }
448
449   /// Estimate and return the size of the stack frame.
450   unsigned estimateStackSize(const MachineFunction &MF) const;
451
452   /// getOffsetAdjustment - Return the correction for frame offsets.
453   ///
454   int getOffsetAdjustment() const { return OffsetAdjustment; }
455
456   /// setOffsetAdjustment - Set the correction for frame offsets.
457   ///
458   void setOffsetAdjustment(int Adj) { OffsetAdjustment = Adj; }
459
460   /// getMaxAlignment - Return the alignment in bytes that this function must be
461   /// aligned to, which is greater than the default stack alignment provided by
462   /// the target.
463   ///
464   unsigned getMaxAlignment() const { return MaxAlignment; }
465
466   /// ensureMaxAlignment - Make sure the function is at least Align bytes
467   /// aligned.
468   void ensureMaxAlignment(unsigned Align);
469
470   /// AdjustsStack - Return true if this function adjusts the stack -- e.g.,
471   /// when calling another function. This is only valid during and after
472   /// prolog/epilog code insertion.
473   bool adjustsStack() const { return AdjustsStack; }
474   void setAdjustsStack(bool V) { AdjustsStack = V; }
475
476   /// hasCalls - Return true if the current function has any function calls.
477   bool hasCalls() const { return HasCalls; }
478   void setHasCalls(bool V) { HasCalls = V; }
479
480   /// Returns true if the function contains any stack-adjusting inline assembly.
481   bool hasInlineAsmWithSPAdjust() const { return HasInlineAsmWithSPAdjust; }
482   void setHasInlineAsmWithSPAdjust(bool B) { HasInlineAsmWithSPAdjust = B; }
483
484   /// getMaxCallFrameSize - Return the maximum size of a call frame that must be
485   /// allocated for an outgoing function call.  This is only available if
486   /// CallFrameSetup/Destroy pseudo instructions are used by the target, and
487   /// then only during or after prolog/epilog code insertion.
488   ///
489   unsigned getMaxCallFrameSize() const { return MaxCallFrameSize; }
490   void setMaxCallFrameSize(unsigned S) { MaxCallFrameSize = S; }
491
492   /// CreateFixedObject - Create a new object at a fixed location on the stack.
493   /// All fixed objects should be created before other objects are created for
494   /// efficiency. By default, fixed objects are immutable. This returns an
495   /// index with a negative value.
496   ///
497   int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool Immutable);
498
499
500   /// isFixedObjectIndex - Returns true if the specified index corresponds to a
501   /// fixed stack object.
502   bool isFixedObjectIndex(int ObjectIdx) const {
503     return ObjectIdx < 0 && (ObjectIdx >= -(int)NumFixedObjects);
504   }
505
506   /// isImmutableObjectIndex - Returns true if the specified index corresponds
507   /// to an immutable object.
508   bool isImmutableObjectIndex(int ObjectIdx) const {
509     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
510            "Invalid Object Idx!");
511     return Objects[ObjectIdx+NumFixedObjects].isImmutable;
512   }
513
514   /// isSpillSlotObjectIndex - Returns true if the specified index corresponds
515   /// to a spill slot..
516   bool isSpillSlotObjectIndex(int ObjectIdx) const {
517     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
518            "Invalid Object Idx!");
519     return Objects[ObjectIdx+NumFixedObjects].isSpillSlot;
520   }
521
522   /// isDeadObjectIndex - Returns true if the specified index corresponds to
523   /// a dead object.
524   bool isDeadObjectIndex(int ObjectIdx) const {
525     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
526            "Invalid Object Idx!");
527     return Objects[ObjectIdx+NumFixedObjects].Size == ~0ULL;
528   }
529
530   /// CreateStackObject - Create a new statically sized stack object, returning
531   /// a nonnegative identifier to represent it.
532   ///
533   int CreateStackObject(uint64_t Size, unsigned Alignment, bool isSS,
534                         bool MayNeedSP = false, const AllocaInst *Alloca = 0);
535
536   /// CreateSpillStackObject - Create a new statically sized stack object that
537   /// represents a spill slot, returning a nonnegative identifier to represent
538   /// it.
539   ///
540   int CreateSpillStackObject(uint64_t Size, unsigned Alignment);
541
542   /// RemoveStackObject - Remove or mark dead a statically sized stack object.
543   ///
544   void RemoveStackObject(int ObjectIdx) {
545     // Mark it dead.
546     Objects[ObjectIdx+NumFixedObjects].Size = ~0ULL;
547   }
548
549   /// CreateVariableSizedObject - Notify the MachineFrameInfo object that a
550   /// variable sized object has been created.  This must be created whenever a
551   /// variable sized object is created, whether or not the index returned is
552   /// actually used.
553   ///
554   int CreateVariableSizedObject(unsigned Alignment);
555
556   /// getCalleeSavedInfo - Returns a reference to call saved info vector for the
557   /// current function.
558   const std::vector<CalleeSavedInfo> &getCalleeSavedInfo() const {
559     return CSInfo;
560   }
561
562   /// setCalleeSavedInfo - Used by prolog/epilog inserter to set the function's
563   /// callee saved information.
564   void setCalleeSavedInfo(const std::vector<CalleeSavedInfo> &CSI) {
565     CSInfo = CSI;
566   }
567
568   /// isCalleeSavedInfoValid - Has the callee saved info been calculated yet?
569   bool isCalleeSavedInfoValid() const { return CSIValid; }
570
571   void setCalleeSavedInfoValid(bool v) { CSIValid = v; }
572
573   /// getPristineRegs - Return a set of physical registers that are pristine on
574   /// entry to the MBB.
575   ///
576   /// Pristine registers hold a value that is useless to the current function,
577   /// but that must be preserved - they are callee saved registers that have not
578   /// been saved yet.
579   ///
580   /// Before the PrologueEpilogueInserter has placed the CSR spill code, this
581   /// method always returns an empty set.
582   BitVector getPristineRegs(const MachineBasicBlock *MBB) const;
583
584   /// print - Used by the MachineFunction printer to print information about
585   /// stack objects. Implemented in MachineFunction.cpp
586   ///
587   void print(const MachineFunction &MF, raw_ostream &OS) const;
588
589   /// dump - Print the function to stderr.
590   void dump(const MachineFunction &MF) const;
591 };
592
593 } // End llvm namespace
594
595 #endif