aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/LiveInterval.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/LiveInterval.h')
-rw-r--r--include/llvm/CodeGen/LiveInterval.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index d6f5c84..f1ae587 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -113,6 +113,26 @@ namespace llvm {
VNInfoList valnos; // value#'s
public:
+
+ struct InstrSlots {
+ enum {
+ LOAD = 0,
+ USE = 1,
+ DEF = 2,
+ STORE = 3,
+ NUM = 4
+ };
+
+ static unsigned scale(unsigned slot, unsigned factor) {
+ unsigned index = slot / NUM,
+ offset = slot % NUM;
+ assert(index <= ~0U / (factor * NUM) &&
+ "Rescaled interval would overflow");
+ return index * NUM * factor + offset;
+ }
+
+ };
+
LiveInterval(unsigned Reg, float Weight, bool IsSS = false)
: reg(Reg), weight(Weight), preference(0) {
if (IsSS)
@@ -414,6 +434,10 @@ namespace llvm {
/// Also remove the value# from value# list.
void removeValNo(VNInfo *ValNo);
+ /// scaleNumbering - Renumber VNI and ranges to provide gaps for new
+ /// instructions.
+ void scaleNumbering(unsigned factor);
+
/// getSize - Returns the sum of sizes of all the LiveRange's.
///
unsigned getSize() const;