mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Fix debug output to include a newline after printing a Value, now
that Value's operator<< doesn't include one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79240 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -183,7 +183,7 @@ ICmpInst *IndVarSimplify::LinearFunctionTestReplace(Loop *L,
|
|||||||
Opcode = ICmpInst::ICMP_EQ;
|
Opcode = ICmpInst::ICMP_EQ;
|
||||||
|
|
||||||
DOUT << "INDVARS: Rewriting loop exit condition to:\n"
|
DOUT << "INDVARS: Rewriting loop exit condition to:\n"
|
||||||
<< " LHS:" << *CmpIndVar // includes a newline
|
<< " LHS:" << *CmpIndVar << '\n'
|
||||||
<< " op:\t"
|
<< " op:\t"
|
||||||
<< (Opcode == ICmpInst::ICMP_NE ? "!=" : "==") << "\n"
|
<< (Opcode == ICmpInst::ICMP_NE ? "!=" : "==") << "\n"
|
||||||
<< " RHS:\t" << *RHS << "\n";
|
<< " RHS:\t" << *RHS << "\n";
|
||||||
@@ -273,7 +273,7 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L,
|
|||||||
|
|
||||||
Value *ExitVal = Rewriter.expandCodeFor(ExitValue, PN->getType(), Inst);
|
Value *ExitVal = Rewriter.expandCodeFor(ExitValue, PN->getType(), Inst);
|
||||||
|
|
||||||
DOUT << "INDVARS: RLEV: AfterLoopVal = " << *ExitVal
|
DOUT << "INDVARS: RLEV: AfterLoopVal = " << *ExitVal << '\n'
|
||||||
<< " LoopVal = " << *Inst << "\n";
|
<< " LoopVal = " << *Inst << "\n";
|
||||||
|
|
||||||
PN->setIncomingValue(i, ExitVal);
|
PN->setIncomingValue(i, ExitVal);
|
||||||
@@ -401,7 +401,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
|
|
||||||
++NumInserted;
|
++NumInserted;
|
||||||
Changed = true;
|
Changed = true;
|
||||||
DOUT << "INDVARS: New CanIV: " << *IndVar;
|
DOUT << "INDVARS: New CanIV: " << *IndVar << '\n';
|
||||||
|
|
||||||
// Now that the official induction variable is established, reinsert
|
// Now that the official induction variable is established, reinsert
|
||||||
// the old canonical-looking variable after it so that the IR remains
|
// the old canonical-looking variable after it so that the IR remains
|
||||||
@@ -506,7 +506,7 @@ void IndVarSimplify::RewriteIVExpressions(Loop *L, const Type *LargestType,
|
|||||||
NewVal->takeName(Op);
|
NewVal->takeName(Op);
|
||||||
User->replaceUsesOfWith(Op, NewVal);
|
User->replaceUsesOfWith(Op, NewVal);
|
||||||
UI->setOperandValToReplace(NewVal);
|
UI->setOperandValToReplace(NewVal);
|
||||||
DOUT << "INDVARS: Rewrote IV '" << *AR << "' " << *Op
|
DOUT << "INDVARS: Rewrote IV '" << *AR << "' " << *Op << '\n'
|
||||||
<< " into = " << *NewVal << "\n";
|
<< " into = " << *NewVal << "\n";
|
||||||
++NumRemoved;
|
++NumRemoved;
|
||||||
Changed = true;
|
Changed = true;
|
||||||
|
@@ -222,7 +222,7 @@ void Reassociate::LinearizeExpr(BinaryOperator *I) {
|
|||||||
isReassociableOp(RHS, I->getOpcode()) &&
|
isReassociableOp(RHS, I->getOpcode()) &&
|
||||||
"Not an expression that needs linearization?");
|
"Not an expression that needs linearization?");
|
||||||
|
|
||||||
DOUT << "Linear" << *LHS << *RHS << *I;
|
DOUT << "Linear" << *LHS << '\n' << *RHS << '\n' << *I << '\n';
|
||||||
|
|
||||||
// Move the RHS instruction to live immediately before I, avoiding breaking
|
// Move the RHS instruction to live immediately before I, avoiding breaking
|
||||||
// dominator properties.
|
// dominator properties.
|
||||||
@@ -235,7 +235,7 @@ void Reassociate::LinearizeExpr(BinaryOperator *I) {
|
|||||||
|
|
||||||
++NumLinear;
|
++NumLinear;
|
||||||
MadeChange = true;
|
MadeChange = true;
|
||||||
DOUT << "Linearized: " << *I;
|
DOUT << "Linearized: " << *I << '\n';
|
||||||
|
|
||||||
// If D is part of this expression tree, tail recurse.
|
// If D is part of this expression tree, tail recurse.
|
||||||
if (isReassociableOp(I->getOperand(1), I->getOpcode()))
|
if (isReassociableOp(I->getOperand(1), I->getOpcode()))
|
||||||
@@ -334,10 +334,10 @@ void Reassociate::RewriteExprTree(BinaryOperator *I,
|
|||||||
if (I->getOperand(0) != Ops[i].Op ||
|
if (I->getOperand(0) != Ops[i].Op ||
|
||||||
I->getOperand(1) != Ops[i+1].Op) {
|
I->getOperand(1) != Ops[i+1].Op) {
|
||||||
Value *OldLHS = I->getOperand(0);
|
Value *OldLHS = I->getOperand(0);
|
||||||
DOUT << "RA: " << *I;
|
DOUT << "RA: " << *I << '\n';
|
||||||
I->setOperand(0, Ops[i].Op);
|
I->setOperand(0, Ops[i].Op);
|
||||||
I->setOperand(1, Ops[i+1].Op);
|
I->setOperand(1, Ops[i+1].Op);
|
||||||
DOUT << "TO: " << *I;
|
DOUT << "TO: " << *I << '\n';
|
||||||
MadeChange = true;
|
MadeChange = true;
|
||||||
++NumChanged;
|
++NumChanged;
|
||||||
|
|
||||||
@@ -350,9 +350,9 @@ void Reassociate::RewriteExprTree(BinaryOperator *I,
|
|||||||
assert(i+2 < Ops.size() && "Ops index out of range!");
|
assert(i+2 < Ops.size() && "Ops index out of range!");
|
||||||
|
|
||||||
if (I->getOperand(1) != Ops[i].Op) {
|
if (I->getOperand(1) != Ops[i].Op) {
|
||||||
DOUT << "RA: " << *I;
|
DOUT << "RA: " << *I << '\n';
|
||||||
I->setOperand(1, Ops[i].Op);
|
I->setOperand(1, Ops[i].Op);
|
||||||
DOUT << "TO: " << *I;
|
DOUT << "TO: " << *I << '\n';
|
||||||
MadeChange = true;
|
MadeChange = true;
|
||||||
++NumChanged;
|
++NumChanged;
|
||||||
}
|
}
|
||||||
@@ -450,7 +450,7 @@ static Instruction *BreakUpSubtract(LLVMContext &Context, Instruction *Sub,
|
|||||||
Sub->replaceAllUsesWith(New);
|
Sub->replaceAllUsesWith(New);
|
||||||
Sub->eraseFromParent();
|
Sub->eraseFromParent();
|
||||||
|
|
||||||
DOUT << "Negated: " << *New;
|
DOUT << "Negated: " << *New << '\n';
|
||||||
return New;
|
return New;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -262,14 +262,14 @@ private:
|
|||||||
//
|
//
|
||||||
inline void markConstant(LatticeVal &IV, Value *V, Constant *C) {
|
inline void markConstant(LatticeVal &IV, Value *V, Constant *C) {
|
||||||
if (IV.markConstant(C)) {
|
if (IV.markConstant(C)) {
|
||||||
DEBUG(errs() << "markConstant: " << *C << ": " << *V);
|
DEBUG(errs() << "markConstant: " << *C << ": " << *V << '\n');
|
||||||
InstWorkList.push_back(V);
|
InstWorkList.push_back(V);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void markForcedConstant(LatticeVal &IV, Value *V, Constant *C) {
|
inline void markForcedConstant(LatticeVal &IV, Value *V, Constant *C) {
|
||||||
IV.markForcedConstant(C);
|
IV.markForcedConstant(C);
|
||||||
DEBUG(errs() << "markForcedConstant: " << *C << ": " << *V);
|
DEBUG(errs() << "markForcedConstant: " << *C << ": " << *V << '\n');
|
||||||
InstWorkList.push_back(V);
|
InstWorkList.push_back(V);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ private:
|
|||||||
if (Function *F = dyn_cast<Function>(V))
|
if (Function *F = dyn_cast<Function>(V))
|
||||||
errs() << "Function '" << F->getName() << "'\n";
|
errs() << "Function '" << F->getName() << "'\n";
|
||||||
else
|
else
|
||||||
errs() << *V);
|
errs() << *V << '\n');
|
||||||
// Only instructions go on the work list
|
// Only instructions go on the work list
|
||||||
OverdefinedInstWorkList.push_back(V);
|
OverdefinedInstWorkList.push_back(V);
|
||||||
}
|
}
|
||||||
@@ -516,7 +516,7 @@ bool SCCPSolver::isEdgeFeasible(BasicBlock *From, BasicBlock *To) {
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
cerr << "Unknown terminator instruction: " << *TI;
|
cerr << "Unknown terminator instruction: " << *TI << '\n';
|
||||||
#endif
|
#endif
|
||||||
llvm_unreachable(0);
|
llvm_unreachable(0);
|
||||||
}
|
}
|
||||||
@@ -1278,7 +1278,7 @@ void SCCPSolver::Solve() {
|
|||||||
Value *I = OverdefinedInstWorkList.back();
|
Value *I = OverdefinedInstWorkList.back();
|
||||||
OverdefinedInstWorkList.pop_back();
|
OverdefinedInstWorkList.pop_back();
|
||||||
|
|
||||||
DEBUG(errs() << "\nPopped off OI-WL: " << *I);
|
DEBUG(errs() << "\nPopped off OI-WL: " << *I << '\n');
|
||||||
|
|
||||||
// "I" got into the work list because it either made the transition from
|
// "I" got into the work list because it either made the transition from
|
||||||
// bottom to constant
|
// bottom to constant
|
||||||
@@ -1296,7 +1296,7 @@ void SCCPSolver::Solve() {
|
|||||||
Value *I = InstWorkList.back();
|
Value *I = InstWorkList.back();
|
||||||
InstWorkList.pop_back();
|
InstWorkList.pop_back();
|
||||||
|
|
||||||
DEBUG(errs() << "\nPopped off I-WL: " << *I);
|
DEBUG(errs() << "\nPopped off I-WL: " << *I << '\n');
|
||||||
|
|
||||||
// "I" got into the work list because it either made the transition from
|
// "I" got into the work list because it either made the transition from
|
||||||
// bottom to constant
|
// bottom to constant
|
||||||
@@ -1316,7 +1316,7 @@ void SCCPSolver::Solve() {
|
|||||||
BasicBlock *BB = BBWorkList.back();
|
BasicBlock *BB = BBWorkList.back();
|
||||||
BBWorkList.pop_back();
|
BBWorkList.pop_back();
|
||||||
|
|
||||||
DEBUG(errs() << "\nPopped off BBWL: " << *BB);
|
DEBUG(errs() << "\nPopped off BBWL: " << *BB << '\n');
|
||||||
|
|
||||||
// Notify all instructions in this basic block that they are newly
|
// Notify all instructions in this basic block that they are newly
|
||||||
// executable.
|
// executable.
|
||||||
|
Reference in New Issue
Block a user