[llvm-commits] [regalloc_linearscan] CVS: llvm/include/llvm/CodeGen/LiveIntervals.h

Alkis Evlogimenos alkis at cs.uiuc.edu
Fri Nov 7 18:24:11 PST 2003


Changes in directory llvm/include/llvm/CodeGen:

LiveIntervals.h updated: 1.1.2.6 -> 1.1.2.7

---
Log message:

LiveIntervals:
   - be a little stricter in terms of constness
   - make runOnMachineFunction reentrant
   - make debugging output prettier
   - fix wrong interval computation of variables that get killed in
     their defining basic block
RegAlloc:
   - disable inactive interval processing, handle the simple case for
     now (ignore holes)
   - improve debugging output
   - succeed in register allocating a simple hello world llvm assembly file


---
Diffs of the changes:  (+14 -2)

Index: llvm/include/llvm/CodeGen/LiveIntervals.h
diff -u llvm/include/llvm/CodeGen/LiveIntervals.h:1.1.2.6 llvm/include/llvm/CodeGen/LiveIntervals.h:1.1.2.7
--- llvm/include/llvm/CodeGen/LiveIntervals.h:1.1.2.6	Wed Nov  5 01:27:17 2003
+++ llvm/include/llvm/CodeGen/LiveIntervals.h	Fri Nov  7 18:23:05 2003
@@ -123,6 +123,7 @@
     typedef std::vector<Interval> Intervals;
     typedef std::map<unsigned, MachineBasicBlock*> MiIndex2MbbMap;
     typedef std::map<MachineBasicBlock*, unsigned> Mbb2MiIndexMap;
+    typedef std::vector<MachineBasicBlock*> MachineBasicBlockPtrs;
 
 private:
     MachineFunction* mf_;
@@ -147,9 +148,18 @@
 
 public:
     virtual void getAnalysisUsage(AnalysisUsage &AU) const;
-    Intervals& getIntervals() { return intervals_; }
+    const Intervals& getIntervals() const { return intervals_; }
     MiIndex2MbbMap& getMiIndex2MbbMap() { return mii2mbbMap_; }
     Mbb2MiIndexMap& getMbb2MiIndexMap() { return mbb2miiMap_; }
+    MachineBasicBlockPtrs getOrderedMachineBasicBlockPtrs() const {
+        MachineBasicBlockPtrs result;
+        for (MbbIndex2MbbMap::const_iterator
+                 it = mbbi2mbbMap_.begin(), itEnd = mbbi2mbbMap_.end();
+             it != itEnd; ++it) {
+            result.push_back(it->second);
+        }
+        return result;
+    }
 
 private:
     /// runOnMachineFunction - pass entry point
@@ -163,7 +173,9 @@
                            MachineInstr* instr,
                            unsigned reg);
 
-    unsigned getInstructionIndex(MachineInstr* instr);
+    unsigned getInstructionIndex(MachineInstr* instr) const;
+
+    void printRegName(unsigned reg) const;
 };
 
 inline bool operator==(const LiveIntervals::Interval& lhs,





More information about the llvm-commits mailing list