[llvm-commits] CVS: llvm/lib/CodeGen/RegAllocLinearScan.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Tue Jan 6 23:32:02 PST 2004


Changes in directory llvm/lib/CodeGen:

RegAllocLinearScan.cpp updated: 1.23 -> 1.24

---
Log message:

Minor cleanups.


---
Diffs of the changes:  (+3 -29)

Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.23 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.24
--- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.23	Tue Jan  6 20:29:33 2004
+++ llvm/lib/CodeGen/RegAllocLinearScan.cpp	Tue Jan  6 23:31:12 2004
@@ -34,17 +34,15 @@
     Statistic<> numReloaded("ra-linearscan", "Number of registers reloaded");
 
     class RA : public MachineFunctionPass {
-    public:
-        typedef std::vector<const LiveIntervals::Interval*> IntervalPtrs;
-
     private:
         MachineFunction* mf_;
         const TargetMachine* tm_;
         const MRegisterInfo* mri_;
-        MachineBasicBlock* currentMbb_;
+        MachineFunction::iterator currentMbb_;
         MachineBasicBlock::iterator currentInstr_;
         typedef LiveIntervals::Intervals Intervals;
         const Intervals* li_;
+        typedef std::vector<const LiveIntervals::Interval*> IntervalPtrs;
         IntervalPtrs active_, inactive_;
 
         typedef std::vector<unsigned> Regs;
@@ -57,9 +55,6 @@
         unsigned regUse_[MRegisterInfo::FirstVirtualRegister];
         unsigned regUseBackup_[MRegisterInfo::FirstVirtualRegister];
 
-        typedef LiveIntervals::MachineBasicBlockPtrs MachineBasicBlockPtrs;
-        MachineBasicBlockPtrs mbbs_;
-
         typedef std::map<unsigned, unsigned> Virt2PhysMap;
         Virt2PhysMap v2pMap_;
 
@@ -204,30 +199,11 @@
     active_.clear();
     inactive_.clear();
 
-    mbbs_ = getAnalysis<LiveIntervals>().getOrderedMachineBasicBlockPtrs();
     v2pMap_.clear();
     v2ssMap_.clear();
     memset(regUse_, 0, sizeof(regUse_));
     memset(regUseBackup_, 0, sizeof(regUseBackup_));
 
-    DEBUG(
-        unsigned i = 0;
-        for (MachineBasicBlockPtrs::iterator
-                 mbbi = mbbs_.begin(), mbbe = mbbs_.end();
-             mbbi != mbbe; ++mbbi) {
-            MachineBasicBlock* mbb = *mbbi;
-            std::cerr << mbb->getBasicBlock()->getName() << '\n';
-            for (MachineBasicBlock::iterator
-                     ii = mbb->begin(), ie = mbb->end();
-                 ii != ie; ++ii) {
-                MachineInstr* instr = *ii;
-
-                std::cerr << i++ << "\t";
-                instr->print(std::cerr, *tm_);
-            }
-        }
-        );
-
     // FIXME: this will work only for the X86 backend. I need to
     // device an algorthm to select the minimal (considering register
     // aliasing) number of temp registers to reserve so that we have 2
@@ -316,10 +292,8 @@
     DEBUG(printVirt2PhysMap());
 
     DEBUG(std::cerr << "Rewrite machine code:\n");
-    for (MachineBasicBlockPtrs::iterator
-             mbbi = mbbs_.begin(), mbbe = mbbs_.end(); mbbi != mbbe; ++mbbi) {
+    for (currentMbb_ = mf_->begin(); currentMbb_ != mf_->end(); ++currentMbb_) {
         instrAdded_ = 0;
-        currentMbb_ = *mbbi;
 
         for (currentInstr_ = currentMbb_->begin();
              currentInstr_ != currentMbb_->end(); ++currentInstr_) {





More information about the llvm-commits mailing list