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

Alkis Evlogimenos alkis at cs.uiuc.edu
Tue Feb 17 18:36:01 PST 2004


Changes in directory llvm/lib/CodeGen:

TwoAddressInstructionPass.cpp updated: 1.17 -> 1.18

---
Log message:

Beautify debug output.


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

Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.17 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.18
--- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.17	Sun Feb 15 15:50:32 2004
+++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp	Tue Feb 17 18:35:06 2004
@@ -28,6 +28,7 @@
 //===----------------------------------------------------------------------===//
 
 #define DEBUG_TYPE "twoaddrinstr"
+#include "llvm/Function.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/CodeGen/LiveVariables.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
@@ -81,6 +82,10 @@
 
     bool MadeChange = false;
 
+    DEBUG(std::cerr << "********** REWRITING TWO-ADDR INSTRS **********\n");
+    DEBUG(std::cerr << "********** Function: "
+          << MF.getFunction()->getName() << '\n');
+
     for (MachineFunction::iterator mbbi = MF.begin(), mbbe = MF.end();
          mbbi != mbbe; ++mbbi) {
         for (MachineBasicBlock::iterator mi = mbbi->begin(), me = mbbi->end();
@@ -93,7 +98,7 @@
 
             ++numTwoAddressInstrs;
 
-            DEBUG(std::cerr << "\tinstruction: "; mi->print(std::cerr, TM));
+            DEBUG(std::cerr << '\t'; mi->print(std::cerr, TM));
 
             assert(mi->getOperand(1).isRegister() &&
                    mi->getOperand(1).getReg() &&
@@ -134,7 +139,7 @@
                 numInstrsAdded += Added;
 
                 MachineBasicBlock::iterator prevMi = prior(mi);
-                DEBUG(std::cerr << "\t\tadded instruction: ";
+                DEBUG(std::cerr << "\t\tprepend:\t";
                       prevMi->print(std::cerr, TM));
 
                 if (LV) {
@@ -164,7 +169,7 @@
             mi->getOperand(0).setUse();
             mi->RemoveOperand(1);
 
-            DEBUG(std::cerr << "\t\tmodified original to: ";
+            DEBUG(std::cerr << "\t\trewrite to:\t";
                   mi->print(std::cerr, TM));
         }
     }





More information about the llvm-commits mailing list