summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-23 04:37:46 +0000
committerChris Lattner <sabre@nondot.org>2009-08-23 04:37:46 +0000
commitb25de3ff6051d69db87c12c8892cfa37ce6e7d64 (patch)
treea6d3f90619240ea8767377f971680ca7896975d5 /llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
parent82e57a6b481bc016e85e39f254f3648594ddf8d2 (diff)
downloadbcm5719-llvm-b25de3ff6051d69db87c12c8892cfa37ce6e7d64.tar.gz
bcm5719-llvm-b25de3ff6051d69db87c12c8892cfa37ce6e7d64.zip
eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups. llvm-svn: 79819
Diffstat (limited to 'llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp b/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
index 26183365a6a..e069cea2201 100644
--- a/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
+++ b/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
@@ -1385,8 +1385,8 @@ namespace {
}
bool makeEqual(Value *V1, Value *V2) {
- DOUT << "makeEqual(" << *V1 << ", " << *V2 << ")\n";
- DOUT << "context is ";
+ DEBUG(errs() << "makeEqual(" << *V1 << ", " << *V2 << ")\n");
+ DEBUG(errs() << "context is ");
DEBUG(if (TopInst)
errs() << "I: " << *TopInst << "\n";
else
@@ -1491,8 +1491,8 @@ namespace {
ToNotify.push_back(I);
}
- DOUT << "Simply removing " << *I2
- << ", replacing with " << *V1 << "\n";
+ DEBUG(errs() << "Simply removing " << *I2
+ << ", replacing with " << *V1 << "\n");
I2->replaceAllUsesWith(V1);
// leave it dead; it'll get erased later.
++NumInstruction;
@@ -1523,8 +1523,8 @@ namespace {
// If that killed the instruction, stop here.
if (I2 && isInstructionTriviallyDead(I2)) {
- DOUT << "Killed all uses of " << *I2
- << ", replacing with " << *V1 << "\n";
+ DEBUG(errs() << "Killed all uses of " << *I2
+ << ", replacing with " << *V1 << "\n");
continue;
}
@@ -1730,10 +1730,12 @@ namespace {
/// add - adds a new property to the work queue
void add(Value *V1, Value *V2, ICmpInst::Predicate Pred,
Instruction *I = NULL) {
- DOUT << "adding " << *V1 << " " << Pred << " " << *V2;
- if (I) DOUT << " context: " << *I;
- else DOUT << " default context (" << Top->getDFSNumIn() << ")";
- DOUT << "\n";
+ DEBUG(errs() << "adding " << *V1 << " " << Pred << " " << *V2);
+ if (I)
+ DEBUG(errs() << " context: " << *I);
+ else
+ DEBUG(errs() << " default context (" << Top->getDFSNumIn() << ")");
+ DEBUG(errs() << "\n");
assert(V1->getType() == V2->getType() &&
"Can't relate two values with different types.");
@@ -2132,9 +2134,9 @@ namespace {
/// solve - process the work queue
void solve() {
- //DOUT << "WorkList entry, size: " << WorkList.size() << "\n";
+ //DEBUG(errs() << "WorkList entry, size: " << WorkList.size() << "\n");
while (!WorkList.empty()) {
- //DOUT << "WorkList size: " << WorkList.size() << "\n";
+ //DEBUG(errs() << "WorkList size: " << WorkList.size() << "\n");
Operation &O = WorkList.front();
TopInst = O.ContextInst;
@@ -2349,7 +2351,7 @@ namespace {
// Tries to simplify each Instruction and add new properties.
void visitInstruction(Instruction *I, DomTreeDFS::Node *DT) {
- DOUT << "Considering instruction " << *I << "\n";
+ DEBUG(errs() << "Considering instruction " << *I << "\n");
DEBUG(VN->dump());
DEBUG(IG->dump());
DEBUG(VR->dump());
@@ -2372,7 +2374,7 @@ namespace {
if (V != I) {
modified = true;
++NumInstruction;
- DOUT << "Removing " << *I << ", replacing with " << *V << "\n";
+ DEBUG(errs() << "Removing " << *I << ", replacing with " << *V << "\n");
if (unsigned n = VN->valueNumber(I, DTDFS->getRootNode()))
if (VN->value(n) == I) IG->remove(n);
VN->remove(I);
@@ -2389,18 +2391,18 @@ namespace {
if (V != Oper) {
modified = true;
++NumVarsReplaced;
- DOUT << "Resolving " << *I;
+ DEBUG(errs() << "Resolving " << *I);
I->setOperand(i, V);
- DOUT << " into " << *I;
+ DEBUG(errs() << " into " << *I);
}
}
#endif
std::string name = I->getParent()->getName();
- DOUT << "push (%" << name << ")\n";
+ DEBUG(errs() << "push (%" << name << ")\n");
Forwards visit(this, DT);
visit.visit(*I);
- DOUT << "pop (%" << name << ")\n";
+ DEBUG(errs() << "pop (%" << name << ")\n");
}
};
OpenPOWER on IntegriCloud