Use std::unique instead of a SmallPtrSet to ensure unique instructions in UseSlots.
[oota-llvm.git] / include / llvm / CodeGen / MachineFrameInfo.h
index c99b5f59c1d5d616755063da3909e3e8d102b244..4ea6aa3396a9aa82ba81217f33ed91daa2a8f465 100644 (file)
@@ -15,8 +15,7 @@
 #define LLVM_CODEGEN_MACHINEFRAMEINFO_H
 
 #include "llvm/ADT/SmallVector.h"
-//#include "llvm/ADT/IndexedMap.h"
-#include "llvm/System/DataTypes.h"
+#include "llvm/Support/DataTypes.h"
 #include <cassert>
 #include <vector>
 
@@ -27,11 +26,11 @@ class TargetRegisterClass;
 class Type;
 class MachineFunction;
 class MachineBasicBlock;
-class TargetFrameInfo;
+class TargetFrameLowering;
 class BitVector;
 
 /// The CalleeSavedInfo class tracks the information need to locate where a
-/// callee saved register in the current frame.
+/// callee saved register is in the current frame.
 class CalleeSavedInfo {
   unsigned Reg;
   int FrameIdx;
@@ -192,13 +191,9 @@ class MachineFrameInfo {
   /// CSIValid - Has CSInfo been set yet?
   bool CSIValid;
 
-  /// SpillObjects - A vector indicating which frame indices refer to
-  /// spill slots.
-  SmallVector<bool, 8> SpillObjects;
-
-  /// TargetFrameInfo - Target information about frame layout.
+  /// TargetFrameLowering - Target information about frame layout.
   ///
-  const TargetFrameInfo &TFI;
+  const TargetFrameLowering &TFI;
 
   /// LocalFrameObjects - References to frame indices which are mapped
   /// into the local frame allocation block. <FrameIdx, LocalOffset>
@@ -207,13 +202,17 @@ class MachineFrameInfo {
   /// LocalFrameSize - Size of the pre-allocated local frame block.
   int64_t LocalFrameSize;
 
-  /// LocalFrameBaseOffset - The base offset from the stack pointer at
-  /// function entry of the local frame blob. Set by PEI for use by
-  /// target in eliminateFrameIndex().
-  int64_t LocalFrameBaseOffset;
+  /// Required alignment of the local object blob, which is the strictest
+  /// alignment of any object in it.
+  unsigned LocalFrameMaxAlign;
+
+  /// Whether the local object blob needs to be allocated together. If not,
+  /// PEI should ignore the isPreAllocated flags on the stack objects and
+  /// just allocate them normally.
+  bool UseLocalStackAllocationBlock;
 
 public:
-    explicit MachineFrameInfo(const TargetFrameInfo &tfi) : TFI(tfi) {
+    explicit MachineFrameInfo(const TargetFrameLowering &tfi) : TFI(tfi) {
     StackSize = NumFixedObjects = OffsetAdjustment = MaxAlignment = 0;
     HasVarSizedObjects = false;
     FrameAddressTaken = false;
@@ -224,7 +223,8 @@ public:
     MaxCallFrameSize = 0;
     CSIValid = false;
     LocalFrameSize = 0;
-    LocalFrameBaseOffset = 0;
+    LocalFrameMaxAlign = 0;
+    UseLocalStackAllocationBlock = false;
   }
 
   /// hasStackObjects - Return true if there are any stack objects in this
@@ -288,20 +288,32 @@ public:
   /// the local object block.
   int64_t getLocalFrameObjectCount() { return LocalFrameObjects.size(); }
 
-  /// setLocalFrameBaseOffset - Set the base SP offset of the local frame
-  /// blob.
-  void setLocalFrameBaseOffset(int64_t o) { LocalFrameBaseOffset = o; }
-
-  /// getLocalFrameBaseOffset - Get the base SP offset of the local frame
-  /// blob.
-  int64_t getLocalFrameBaseOffset() const { return LocalFrameBaseOffset; }
-
   /// setLocalFrameSize - Set the size of the local object blob.
   void setLocalFrameSize(int64_t sz) { LocalFrameSize = sz; }
 
   /// getLocalFrameSize - Get the size of the local object blob.
   int64_t getLocalFrameSize() const { return LocalFrameSize; }
 
+  /// setLocalFrameMaxAlign - Required alignment of the local object blob,
+  /// which is the strictest alignment of any object in it.
+  void setLocalFrameMaxAlign(unsigned Align) { LocalFrameMaxAlign = Align; }
+
+  /// getLocalFrameMaxAlign - Return the required alignment of the local
+  /// object blob.
+  unsigned getLocalFrameMaxAlign() const { return LocalFrameMaxAlign; }
+
+  /// getUseLocalStackAllocationBlock - Get whether the local allocation blob
+  /// should be allocated together or let PEI allocate the locals in it
+  /// directly.
+  bool getUseLocalStackAllocationBlock() {return UseLocalStackAllocationBlock;}
+
+  /// setUseLocalStackAllocationBlock - Set whether the local allocation blob
+  /// should be allocated together or let PEI allocate the locals in it
+  /// directly.
+  void setUseLocalStackAllocationBlock(bool v) {
+    UseLocalStackAllocationBlock = v;
+  }
+
   /// isObjectPreAllocated - Return true if the object was pre-allocated into
   /// the local block.
   bool isObjectPreAllocated(int ObjectIdx) const {