aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/Reassociate.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-22 17:17:27 +0000
committerChris Lattner <sabre@nondot.org>2002-05-22 17:17:27 +0000
commitf016ea4ff80c56c467247a90567dd07bddb590f3 (patch)
tree83ccc99063e91b0f13ad44491575a52378fa0cb5 /lib/Transforms/Scalar/Reassociate.cpp
parent70e60cbd4dd59b61e3e9d0a55f24cf92b0dc8724 (diff)
Use the new DEBUG(x) macro to allow debugging code to be enabled on the commandline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2713 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index f669262ee6..fcbf8b38c9 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -27,9 +27,6 @@
#include "Support/PostOrderIterator.h"
#include "Support/StatisticReporter.h"
-//#define DEBUG_REASSOC(x) std::cerr << x
-#define DEBUG_REASSOC(x)
-
static Statistic<> NumLinear ("reassociate\t- Number of insts linearized");
static Statistic<> NumChanged("reassociate\t- Number of insts reassociated");
static Statistic<> NumSwapped("reassociate\t- Number of insts with operands swapped");
@@ -125,7 +122,7 @@ bool Reassociate::ReassociateExpr(BinaryOperator *I) {
std::swap(LHSRank, RHSRank);
Changed = true;
++NumSwapped;
- DEBUG_REASSOC("Transposed: " << I << " Result BB: " << I->getParent());
+ DEBUG(std::cerr << "Transposed: " << I << " Result BB: " << I->getParent());
}
// If the LHS is the same operator as the current one is, and if we are the
@@ -147,7 +144,8 @@ bool Reassociate::ReassociateExpr(BinaryOperator *I) {
I->setOperand(1, LHSI);
++NumChanged;
- DEBUG_REASSOC("Reassociated: " << I << " Result BB: " <<I->getParent());
+ DEBUG(std::cerr << "Reassociated: " << I << " Result BB: "
+ << I->getParent());
// Since we modified the RHS instruction, make sure that we recheck it.
ReassociateExpr(LHSI);
@@ -238,7 +236,7 @@ bool Reassociate::ReassociateBB(BasicBlock *BB) {
I = Tmp;
++NumLinear;
Changed = true;
- DEBUG_REASSOC("Linearized: " << I << " Result BB: " << BB);
+ DEBUG(std::cerr << "Linearized: " << I << " Result BB: " << BB);
}
// Make sure that this expression is correctly reassociated with respect
@@ -269,7 +267,7 @@ bool Reassociate::ReassociateBB(BasicBlock *BB) {
New->setOperand(1, NegateValue(NegatedValue, BB, BI));
--BI;
Changed = true;
- DEBUG_REASSOC("Negated: " << New << " Result BB: " << BB);
+ DEBUG(std::cerr << "Negated: " << New << " Result BB: " << BB);
}
}