[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervals.cpp LiveVariables.cpp MachineBasicBlock.cpp MachineInstr.cpp Makefile PHIElimination.cpp PrologEpilogInserter.cpp RegAllocLocal.cpp RegAllocSimple.cpp TwoAddressInstructionPass.cpp VirtRegMap.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jun 2 01:04:07 PDT 2004


Changes in directory llvm/lib/CodeGen:

LiveIntervals.cpp updated: 1.76 -> 1.77
LiveVariables.cpp updated: 1.31 -> 1.32
MachineBasicBlock.cpp updated: 1.13 -> 1.14
MachineInstr.cpp updated: 1.99 -> 1.100
Makefile updated: 1.17 -> 1.18
PHIElimination.cpp updated: 1.26 -> 1.27
PrologEpilogInserter.cpp updated: 1.22 -> 1.23
RegAllocLocal.cpp updated: 1.61 -> 1.62
RegAllocSimple.cpp updated: 1.55 -> 1.56
TwoAddressInstructionPass.cpp updated: 1.18 -> 1.19
VirtRegMap.cpp updated: 1.12 -> 1.13

---
Log message:

Adjust to new TargetMachine interface


---
Diffs of the changes:  (+18 -19)

Index: llvm/lib/CodeGen/LiveIntervals.cpp
diff -u llvm/lib/CodeGen/LiveIntervals.cpp:1.76 llvm/lib/CodeGen/LiveIntervals.cpp:1.77
--- llvm/lib/CodeGen/LiveIntervals.cpp:1.76	Sun May 30 02:46:27 2004
+++ llvm/lib/CodeGen/LiveIntervals.cpp	Wed Jun  2 00:57:12 2004
@@ -122,7 +122,7 @@
     // perform a final pass over the instructions and compute spill
     // weights, coalesce virtual registers and remove identity moves
     const LoopInfo& loopInfo = getAnalysis<LoopInfo>();
-    const TargetInstrInfo& tii = tm_->getInstrInfo();
+    const TargetInstrInfo& tii = *tm_->getInstrInfo();
 
     for (MachineFunction::iterator mbbi = mf_->begin(), mbbe = mf_->end();
          mbbi != mbbe; ++mbbi) {
@@ -424,7 +424,7 @@
         for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end();
              mi != miEnd; ++mi) {
             const TargetInstrDescriptor& tid =
-                tm_->getInstrInfo().get(mi->getOpcode());
+                tm_->getInstrInfo()->get(mi->getOpcode());
             DEBUG(std::cerr << getInstructionIndex(mi) << "\t";
                   mi->print(std::cerr, *tm_));
 
@@ -455,7 +455,7 @@
 {
     DEBUG(std::cerr << "********** JOINING INTERVALS ***********\n");
 
-    const TargetInstrInfo& tii = tm_->getInstrInfo();
+    const TargetInstrInfo& tii = *tm_->getInstrInfo();
 
     for (MachineFunction::iterator mbbi = mf_->begin(), mbbe = mf_->end();
          mbbi != mbbe; ++mbbi) {
@@ -464,8 +464,7 @@
 
         for (MachineBasicBlock::iterator mi = mbb->begin(), mie = mbb->end();
              mi != mie; ++mi) {
-            const TargetInstrDescriptor& tid =
-                tm_->getInstrInfo().get(mi->getOpcode());
+            const TargetInstrDescriptor& tid = tii.get(mi->getOpcode());
             DEBUG(std::cerr << getInstructionIndex(mi) << '\t';
                   mi->print(std::cerr, *tm_););
 


Index: llvm/lib/CodeGen/LiveVariables.cpp
diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.31 llvm/lib/CodeGen/LiveVariables.cpp:1.32
--- llvm/lib/CodeGen/LiveVariables.cpp:1.31	Mon May 10 00:12:43 2004
+++ llvm/lib/CodeGen/LiveVariables.cpp	Wed Jun  2 00:57:12 2004
@@ -159,7 +159,7 @@
 }
 
 bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
-  const TargetInstrInfo &TII = MF.getTarget().getInstrInfo();
+  const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo();
   RegInfo = MF.getTarget().getRegisterInfo();
   assert(RegInfo && "Target doesn't have register information?");
 


Index: llvm/lib/CodeGen/MachineBasicBlock.cpp
diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.13 llvm/lib/CodeGen/MachineBasicBlock.cpp:1.14
--- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.13	Mon May 24 02:14:27 2004
+++ llvm/lib/CodeGen/MachineBasicBlock.cpp	Wed Jun  2 00:57:12 2004
@@ -81,7 +81,7 @@
 
 MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator()
 {
-  const TargetInstrInfo& TII = getParent()->getTarget().getInstrInfo();
+  const TargetInstrInfo& TII = *getParent()->getTarget().getInstrInfo();
   iterator I = end();
   while (I != begin() && TII.isTerminatorInstr((--I)->getOpcode()));
   if (I != end() && !TII.isTerminatorInstr(I->getOpcode())) ++I;


Index: llvm/lib/CodeGen/MachineInstr.cpp
diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.99 llvm/lib/CodeGen/MachineInstr.cpp:1.100
--- llvm/lib/CodeGen/MachineInstr.cpp:1.99	Sun May 23 22:14:16 2004
+++ llvm/lib/CodeGen/MachineInstr.cpp	Wed Jun  2 00:57:12 2004
@@ -322,7 +322,7 @@
     OS << " = ";
     ++StartOp;   // Don't print this operand again!
   }
-  OS << TM.getInstrInfo().getName(getOpcode());
+  OS << TM.getInstrInfo()->getName(getOpcode());
   
   for (unsigned i = StartOp, e = getNumOperands(); i != e; ++i) {
     const MachineOperand& mop = getOperand(i);


Index: llvm/lib/CodeGen/Makefile
diff -u llvm/lib/CodeGen/Makefile:1.17 llvm/lib/CodeGen/Makefile:1.18
--- llvm/lib/CodeGen/Makefile:1.17	Fri Jan  9 00:24:06 2004
+++ llvm/lib/CodeGen/Makefile	Wed Jun  2 00:57:12 2004
@@ -8,7 +8,7 @@
 ##===----------------------------------------------------------------------===##
 
 LEVEL = ../..
-PARALLEL_DIRS = InstrSched SelectionDAG
+#PARALLEL_DIRS = InstrSched SelectionDAG
 LIBRARYNAME = codegen
 
 include $(LEVEL)/Makefile.common


Index: llvm/lib/CodeGen/PHIElimination.cpp
diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.26 llvm/lib/CodeGen/PHIElimination.cpp:1.27
--- llvm/lib/CodeGen/PHIElimination.cpp:1.26	Wed May 12 16:47:57 2004
+++ llvm/lib/CodeGen/PHIElimination.cpp	Wed Jun  2 00:57:12 2004
@@ -66,7 +66,7 @@
     return false;   // Quick exit for normal case...
 
   LiveVariables *LV = getAnalysisToUpdate<LiveVariables>();
-  const TargetInstrInfo &MII = MF.getTarget().getInstrInfo();
+  const TargetInstrInfo &MII = *MF.getTarget().getInstrInfo();
   const MRegisterInfo *RegInfo = MF.getTarget().getRegisterInfo();
 
   // VRegPHIUseCount - Keep track of the number of times each virtual register


Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp
diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.22 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.23
--- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.22	Sun Feb 15 15:37:17 2004
+++ llvm/lib/CodeGen/PrologEpilogInserter.cpp	Wed Jun  2 00:57:12 2004
@@ -82,7 +82,7 @@
 ///
 void PEI::saveCallerSavedRegisters(MachineFunction &Fn) {
   const MRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo();
-  const TargetFrameInfo &FrameInfo = Fn.getTarget().getFrameInfo();
+  const TargetFrameInfo &FrameInfo = *Fn.getTarget().getFrameInfo();
 
   // Get the callee saved register list...
   const unsigned *CSRegs = RegInfo->getCalleeSaveRegs();
@@ -170,7 +170,7 @@
   }
 
   // Add code to restore the callee-save registers in each exiting block.
-  const TargetInstrInfo &TII = Fn.getTarget().getInstrInfo();
+  const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo();
   for (MachineFunction::iterator FI = Fn.begin(), E = Fn.end(); FI != E; ++FI) {
     // If last instruction is a return instruction, add an epilogue
     if (!FI->empty() && TII.isReturn(FI->back().getOpcode())) {
@@ -191,7 +191,7 @@
 /// abstract stack objects...
 ///
 void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
-  const TargetFrameInfo &TFI = Fn.getTarget().getFrameInfo();
+  const TargetFrameInfo &TFI = *Fn.getTarget().getFrameInfo();
   
   bool StackGrowsDown =
     TFI.getStackGrowthDirection() == TargetFrameInfo::StackGrowsDown;
@@ -245,7 +245,7 @@
   Fn.getTarget().getRegisterInfo()->emitPrologue(Fn);
 
   // Add epilogue to restore the callee-save registers in each exiting block
-  const TargetInstrInfo &TII = Fn.getTarget().getInstrInfo();
+  const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo();
   for (MachineFunction::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) {
     // If last instruction is a return instruction, add an epilogue
     if (!I->empty() && TII.isReturn(I->back().getOpcode()))


Index: llvm/lib/CodeGen/RegAllocLocal.cpp
diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.61 llvm/lib/CodeGen/RegAllocLocal.cpp:1.62
--- llvm/lib/CodeGen/RegAllocLocal.cpp:1.61	Sun Mar 14 01:19:51 2004
+++ llvm/lib/CodeGen/RegAllocLocal.cpp	Wed Jun  2 00:57:12 2004
@@ -520,7 +520,7 @@
   // loop over each instruction
   MachineBasicBlock::iterator MI = MBB.begin();
   for (; MI != MBB.end(); ++MI) {
-    const TargetInstrDescriptor &TID = TM->getInstrInfo().get(MI->getOpcode());
+    const TargetInstrDescriptor &TID = TM->getInstrInfo()->get(MI->getOpcode());
     DEBUG(std::cerr << "\nStarting RegAlloc of: " << *MI;
           std::cerr << "  Regs have values: ";
           for (unsigned i = 0; i != RegInfo->getNumRegs(); ++i)


Index: llvm/lib/CodeGen/RegAllocSimple.cpp
diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.55 llvm/lib/CodeGen/RegAllocSimple.cpp:1.56
--- llvm/lib/CodeGen/RegAllocSimple.cpp:1.55	Mon Mar 15 19:45:55 2004
+++ llvm/lib/CodeGen/RegAllocSimple.cpp	Wed Jun  2 00:57:12 2004
@@ -159,7 +159,7 @@
     // a preliminary pass that will invalidate any registers that
     // are used by the instruction (including implicit uses)
     unsigned Opcode = MI->getOpcode();
-    const TargetInstrDescriptor &Desc = TM->getInstrInfo().get(Opcode);
+    const TargetInstrDescriptor &Desc = TM->getInstrInfo()->get(Opcode);
     const unsigned *Regs = Desc.ImplicitUses;
     while (*Regs)
       RegsUsed[*Regs++] = true;
@@ -184,7 +184,7 @@
         unsigned physReg = Virt2PhysRegMap[virtualReg];
         if (physReg == 0) {
           if (op.isDef()) {
-            if (!TM->getInstrInfo().isTwoAddrInstr(MI->getOpcode()) || i) {
+            if (!TM->getInstrInfo()->isTwoAddrInstr(MI->getOpcode()) || i) {
               physReg = getFreeReg(virtualReg);
             } else {
               // must be same register number as the first operand


Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.18 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.19
--- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.18	Tue Feb 17 18:35:06 2004
+++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp	Wed Jun  2 00:57:12 2004
@@ -77,7 +77,7 @@
     DEBUG(std::cerr << "Machine Function\n");
     const TargetMachine &TM = MF.getTarget();
     const MRegisterInfo &MRI = *TM.getRegisterInfo();
-    const TargetInstrInfo &TII = TM.getInstrInfo();
+    const TargetInstrInfo &TII = *TM.getInstrInfo();
     LiveVariables* LV = getAnalysisToUpdate<LiveVariables>();
 
     bool MadeChange = false;


Index: llvm/lib/CodeGen/VirtRegMap.cpp
diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.12 llvm/lib/CodeGen/VirtRegMap.cpp:1.13
--- llvm/lib/CodeGen/VirtRegMap.cpp:1.12	Sat May 29 15:38:05 2004
+++ llvm/lib/CodeGen/VirtRegMap.cpp	Wed Jun  2 00:57:12 2004
@@ -191,7 +191,7 @@
         bool runOnMachineFunction(MachineFunction& mf, const VirtRegMap& vrm) {
             mf_ = &mf;
             tm_ = &mf_->getTarget();
-            tii_ = &tm_->getInstrInfo();
+            tii_ = tm_->getInstrInfo();
             mri_ = tm_->getRegisterInfo();
             vrm_ = &vrm;
             p2vMap_.assign(mri_->getNumRegs(), 0);





More information about the llvm-commits mailing list