Opcode = ICmpInst::ICMP_EQ;
DOUT << "INDVARS: Rewriting loop exit condition to:\n"
- << " LHS:" << *CmpIndVar // includes a newline
+ << " LHS:" << *CmpIndVar << '\n'
<< " op:\t"
<< (Opcode == ICmpInst::ICMP_NE ? "!=" : "==") << "\n"
<< " RHS:\t" << *RHS << "\n";
Value *ExitVal = Rewriter.expandCodeFor(ExitValue, PN->getType(), Inst);
- DOUT << "INDVARS: RLEV: AfterLoopVal = " << *ExitVal
+ DOUT << "INDVARS: RLEV: AfterLoopVal = " << *ExitVal << '\n'
<< " LoopVal = " << *Inst << "\n";
PN->setIncomingValue(i, ExitVal);
++NumInserted;
Changed = true;
- DOUT << "INDVARS: New CanIV: " << *IndVar;
+ DOUT << "INDVARS: New CanIV: " << *IndVar << '\n';
// Now that the official induction variable is established, reinsert
// the old canonical-looking variable after it so that the IR remains
NewVal->takeName(Op);
User->replaceUsesOfWith(Op, NewVal);
UI->setOperandValToReplace(NewVal);
- DOUT << "INDVARS: Rewrote IV '" << *AR << "' " << *Op
+ DOUT << "INDVARS: Rewrote IV '" << *AR << "' " << *Op << '\n'
<< " into = " << *NewVal << "\n";
++NumRemoved;
Changed = true;
isReassociableOp(RHS, I->getOpcode()) &&
"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
// dominator properties.
++NumLinear;
MadeChange = true;
- DOUT << "Linearized: " << *I;
+ DOUT << "Linearized: " << *I << '\n';
// If D is part of this expression tree, tail recurse.
if (isReassociableOp(I->getOperand(1), I->getOpcode()))
if (I->getOperand(0) != Ops[i].Op ||
I->getOperand(1) != Ops[i+1].Op) {
Value *OldLHS = I->getOperand(0);
- DOUT << "RA: " << *I;
+ DOUT << "RA: " << *I << '\n';
I->setOperand(0, Ops[i].Op);
I->setOperand(1, Ops[i+1].Op);
- DOUT << "TO: " << *I;
+ DOUT << "TO: " << *I << '\n';
MadeChange = true;
++NumChanged;
assert(i+2 < Ops.size() && "Ops index out of range!");
if (I->getOperand(1) != Ops[i].Op) {
- DOUT << "RA: " << *I;
+ DOUT << "RA: " << *I << '\n';
I->setOperand(1, Ops[i].Op);
- DOUT << "TO: " << *I;
+ DOUT << "TO: " << *I << '\n';
MadeChange = true;
++NumChanged;
}
Sub->replaceAllUsesWith(New);
Sub->eraseFromParent();
- DOUT << "Negated: " << *New;
+ DOUT << "Negated: " << *New << '\n';
return New;
}
//
inline void markConstant(LatticeVal &IV, Value *V, Constant *C) {
if (IV.markConstant(C)) {
- DEBUG(errs() << "markConstant: " << *C << ": " << *V);
+ DEBUG(errs() << "markConstant: " << *C << ": " << *V << '\n');
InstWorkList.push_back(V);
}
}
inline void markForcedConstant(LatticeVal &IV, Value *V, Constant *C) {
IV.markForcedConstant(C);
- DEBUG(errs() << "markForcedConstant: " << *C << ": " << *V);
+ DEBUG(errs() << "markForcedConstant: " << *C << ": " << *V << '\n');
InstWorkList.push_back(V);
}
if (Function *F = dyn_cast<Function>(V))
errs() << "Function '" << F->getName() << "'\n";
else
- errs() << *V);
+ errs() << *V << '\n');
// Only instructions go on the work list
OverdefinedInstWorkList.push_back(V);
}
return false;
} else {
#ifndef NDEBUG
- cerr << "Unknown terminator instruction: " << *TI;
+ cerr << "Unknown terminator instruction: " << *TI << '\n';
#endif
llvm_unreachable(0);
}
Value *I = OverdefinedInstWorkList.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
// bottom to constant
Value *I = InstWorkList.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
// bottom to constant
BasicBlock *BB = BBWorkList.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
// executable.