Added a TargetRegisterInfo interface for accessing register pressure sets.
authorAndrew Trick <atrick@apple.com>
Tue, 10 Apr 2012 02:25:26 +0000 (02:25 +0000)
committerAndrew Trick <atrick@apple.com>
Tue, 10 Apr 2012 02:25:26 +0000 (02:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154375 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetRegisterInfo.h

index c6e308691df0b5819dbc629f2a4fe1189053da81..48b850e49f4c48ab27d7c533ef5ddf0959012e96 100644 (file)
@@ -500,11 +500,29 @@ public:
   /// getRegPressureLimit - Return the register pressure "high water mark" for
   /// the specific register class. The scheduler is in high register pressure
   /// mode (for the specific register class) if it goes over the limit.
+  ///
+  /// Note: this is the old register pressure model that relies on a manually
+  /// specified representative register class per value type.
   virtual unsigned getRegPressureLimit(const TargetRegisterClass *RC,
                                        MachineFunction &MF) const {
     return 0;
   }
 
+  /// Get the weight in units of pressure for this register class.
+  virtual unsigned getRegClassWeight(const TargetRegisterClass *RC) const = 0;
+
+  /// Get the number of dimensions of register pressure.
+  virtual unsigned getNumRegPressureSets() const = 0;
+
+  /// Get the register unit pressure limit for this dimension.
+  /// This limit must be adjusted dynamically for reserved registers.
+  virtual unsigned getRegPressureSetLimit(unsigned Idx) const = 0;
+
+  /// Get the dimensions of register pressure impacted by this register class.
+  /// Returns a -1 terminated array of pressure set IDs.
+  virtual const int *getRegClassPressureSets(
+    const TargetRegisterClass *RC) const = 0;
+
   /// getRawAllocationOrder - Returns the register allocation order for a
   /// specified register class with a target-dependent hint. The returned list
   /// may contain reserved registers that cannot be allocated.