//===----------------------------------------------------------------------===//
void DAGTypeLegalizer::SoftenFloatResult(SDNode *N, unsigned ResNo) {
- DEBUG(cerr << "Soften float result " << ResNo << ": "; N->dump(&DAG);
- cerr << "\n");
+ DEBUG(errs() << "Soften float result " << ResNo << ": "; N->dump(&DAG);
+ errs() << "\n");
SDValue R = SDValue();
switch (N->getOpcode()) {
default:
#ifndef NDEBUG
- cerr << "SoftenFloatResult #" << ResNo << ": ";
- N->dump(&DAG); cerr << "\n";
+ errs() << "SoftenFloatResult #" << ResNo << ": ";
+ N->dump(&DAG); errs() << "\n";
#endif
llvm_unreachable("Do not know how to soften the result of this operator!");
//===----------------------------------------------------------------------===//
bool DAGTypeLegalizer::SoftenFloatOperand(SDNode *N, unsigned OpNo) {
- DEBUG(cerr << "Soften float operand " << OpNo << ": "; N->dump(&DAG);
- cerr << "\n");
+ DEBUG(errs() << "Soften float operand " << OpNo << ": "; N->dump(&DAG);
+ errs() << "\n");
SDValue Res = SDValue();
switch (N->getOpcode()) {
default:
#ifndef NDEBUG
- cerr << "SoftenFloatOperand Op #" << OpNo << ": ";
- N->dump(&DAG); cerr << "\n";
+ errs() << "SoftenFloatOperand Op #" << OpNo << ": ";
+ N->dump(&DAG); errs() << "\n";
#endif
llvm_unreachable("Do not know how to soften this operator's operand!");
/// have invalid operands or may have other results that need promotion, we just
/// know that (at least) one result needs expansion.
void DAGTypeLegalizer::ExpandFloatResult(SDNode *N, unsigned ResNo) {
- DEBUG(cerr << "Expand float result: "; N->dump(&DAG); cerr << "\n");
+ DEBUG(errs() << "Expand float result: "; N->dump(&DAG); errs() << "\n");
SDValue Lo, Hi;
Lo = Hi = SDValue();
switch (N->getOpcode()) {
default:
#ifndef NDEBUG
- cerr << "ExpandFloatResult #" << ResNo << ": ";
- N->dump(&DAG); cerr << "\n";
+ errs() << "ExpandFloatResult #" << ResNo << ": ";
+ N->dump(&DAG); errs() << "\n";
#endif
llvm_unreachable("Do not know how to expand the result of this operator!");
/// types of the node are known to be legal, but other operands of the node may
/// need promotion or expansion as well as the specified one.
bool DAGTypeLegalizer::ExpandFloatOperand(SDNode *N, unsigned OpNo) {
- DEBUG(cerr << "Expand float operand: "; N->dump(&DAG); cerr << "\n");
+ DEBUG(errs() << "Expand float operand: "; N->dump(&DAG); errs() << "\n");
SDValue Res = SDValue();
if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType())
switch (N->getOpcode()) {
default:
#ifndef NDEBUG
- cerr << "ExpandFloatOperand Op #" << OpNo << ": ";
- N->dump(&DAG); cerr << "\n";
+ errs() << "ExpandFloatOperand Op #" << OpNo << ": ";
+ N->dump(&DAG); errs() << "\n";
#endif
llvm_unreachable("Do not know how to expand this operator's operand!");
#include "LegalizeTypes.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
//===----------------------------------------------------------------------===//
/// may also have invalid operands or may have other results that need
/// expansion, we just know that (at least) one result needs promotion.
void DAGTypeLegalizer::PromoteIntegerResult(SDNode *N, unsigned ResNo) {
- DEBUG(cerr << "Promote integer result: "; N->dump(&DAG); cerr << "\n");
+ DEBUG(errs() << "Promote integer result: "; N->dump(&DAG); errs() << "\n");
SDValue Res = SDValue();
// See if the target wants to custom expand this node.
switch (N->getOpcode()) {
default:
#ifndef NDEBUG
- cerr << "PromoteIntegerResult #" << ResNo << ": ";
- N->dump(&DAG); cerr << "\n";
+ errs() << "PromoteIntegerResult #" << ResNo << ": ";
+ N->dump(&DAG); errs() << "\n";
#endif
llvm_unreachable("Do not know how to promote this operator!");
case ISD::AssertSext: Res = PromoteIntRes_AssertSext(N); break;
/// result types of the node are known to be legal, but other operands of the
/// node may need promotion or expansion as well as the specified one.
bool DAGTypeLegalizer::PromoteIntegerOperand(SDNode *N, unsigned OpNo) {
- DEBUG(cerr << "Promote integer operand: "; N->dump(&DAG); cerr << "\n");
+ DEBUG(errs() << "Promote integer operand: "; N->dump(&DAG); errs() << "\n");
SDValue Res = SDValue();
if (CustomLowerNode(N, N->getOperand(OpNo).getValueType(), false))
switch (N->getOpcode()) {
default:
#ifndef NDEBUG
- cerr << "PromoteIntegerOperand Op #" << OpNo << ": ";
- N->dump(&DAG); cerr << "\n";
+ errs() << "PromoteIntegerOperand Op #" << OpNo << ": ";
+ N->dump(&DAG); errs() << "\n";
#endif
llvm_unreachable("Do not know how to promote this operator's operand!");
/// have invalid operands or may have other results that need promotion, we just
/// know that (at least) one result needs expansion.
void DAGTypeLegalizer::ExpandIntegerResult(SDNode *N, unsigned ResNo) {
- DEBUG(cerr << "Expand integer result: "; N->dump(&DAG); cerr << "\n");
+ DEBUG(errs() << "Expand integer result: "; N->dump(&DAG); errs() << "\n");
SDValue Lo, Hi;
Lo = Hi = SDValue();
switch (N->getOpcode()) {
default:
#ifndef NDEBUG
- cerr << "ExpandIntegerResult #" << ResNo << ": ";
- N->dump(&DAG); cerr << "\n";
+ errs() << "ExpandIntegerResult #" << ResNo << ": ";
+ N->dump(&DAG); errs() << "\n";
#endif
llvm_unreachable("Do not know how to expand the result of this operator!");
/// result types of the node are known to be legal, but other operands of the
/// node may need promotion or expansion as well as the specified one.
bool DAGTypeLegalizer::ExpandIntegerOperand(SDNode *N, unsigned OpNo) {
- DEBUG(cerr << "Expand integer operand: "; N->dump(&DAG); cerr << "\n");
+ DEBUG(errs() << "Expand integer operand: "; N->dump(&DAG); errs() << "\n");
SDValue Res = SDValue();
if (CustomLowerNode(N, N->getOperand(OpNo).getValueType(), false))
switch (N->getOpcode()) {
default:
#ifndef NDEBUG
- cerr << "ExpandIntegerOperand Op #" << OpNo << ": ";
- N->dump(&DAG); cerr << "\n";
+ errs() << "ExpandIntegerOperand Op #" << OpNo << ": ";
+ N->dump(&DAG); errs() << "\n";
#endif
llvm_unreachable("Do not know how to expand this operator's operand!");
if (I->second == PN)
I->second = v;
- DEBUG(cerr << "GVN removed: " << *PN);
+ DEBUG(errs() << "GVN removed: " << *PN);
MD->removeInstruction(PN);
PN->eraseFromParent();
DEBUG(verifyRemoved(PN));
SmallVector<MemoryDependenceAnalysis::NonLocalDepEntry, 64> Deps;
MD->getNonLocalPointerDependency(LI->getOperand(0), true, LI->getParent(),
Deps);
- //DEBUG(cerr << "INVESTIGATING NONLOCAL LOAD: " << Deps.size() << *LI);
+ //DEBUG(errs() << "INVESTIGATING NONLOCAL LOAD: " << Deps.size() << *LI);
// If we had to process more than one hundred blocks to find the
// dependencies, this load isn't worth worrying about. Optimizing
// clobber in the current block. Reject this early.
if (Deps.size() == 1 && Deps[0].second.isClobber()) {
DEBUG(
- DOUT << "GVN: non-local load ";
- WriteAsOperand(*DOUT.stream(), LI);
- DOUT << " is clobbered by " << *Deps[0].second.getInst();
+ errs() << "GVN: non-local load ";
+ WriteAsOperand(errs(), LI);
+ errs() << " is clobbered by " << *Deps[0].second.getInst();
);
return false;
}
for (SmallPtrSet<Instruction*, 4>::iterator I = p.begin(), E = p.end();
I != E; ++I) {
if ((*I)->getParent() == LI->getParent()) {
- DEBUG(cerr << "GVN REMOVING NONLOCAL LOAD #1: " << *LI);
+ DEBUG(errs() << "GVN REMOVING NONLOCAL LOAD #1: " << *LI);
LI->replaceAllUsesWith(*I);
if (isa<PointerType>((*I)->getType()))
MD->invalidateCachedPointerInfo(*I);
ValuesPerBlock.push_back(std::make_pair((*I)->getParent(), *I));
}
- DEBUG(cerr << "GVN REMOVING NONLOCAL LOAD: " << *LI);
+ DEBUG(errs() << "GVN REMOVING NONLOCAL LOAD: " << *LI);
DenseMap<BasicBlock*, Value*> BlockReplValues;
BlockReplValues.insert(ValuesPerBlock.begin(), ValuesPerBlock.end());
// Okay, we can eliminate this load by inserting a reload in the predecessor
// and using PHI construction to get the value in the other predecessors, do
// it.
- DEBUG(cerr << "GVN REMOVING PRE LOAD: " << *LI);
+ DEBUG(errs() << "GVN REMOVING PRE LOAD: " << *LI);
Value *NewLoad = new LoadInst(LoadPtr, LI->getName()+".pre", false,
LI->getAlignment(),
if (dep.isClobber()) {
DEBUG(
// fast print dep, using operator<< on instruction would be too slow
- DOUT << "GVN: load ";
- WriteAsOperand(*DOUT.stream(), L);
+ errs() << "GVN: load ";
+ WriteAsOperand(errs(), L);
Instruction *I = dep.getInst();
- DOUT << " is clobbered by " << *I;
+ errs() << " is clobbered by " << *I;
);
return false;
}
unsigned Iteration = 0;
while (shouldContinue) {
- DEBUG(cerr << "GVN iteration: " << Iteration << "\n");
+ DEBUG(errs() << "GVN iteration: " << Iteration << "\n");
shouldContinue = iterateOnFunction(F);
changed |= shouldContinue;
++Iteration;
for (SmallVector<Instruction*, 4>::iterator I = toErase.begin(),
E = toErase.end(); I != E; ++I) {
- DEBUG(cerr << "GVN removed: " << **I);
+ DEBUG(errs() << "GVN removed: " << **I);
MD->removeInstruction(*I);
(*I)->eraseFromParent();
DEBUG(verifyRemoved(*I));
MD->invalidateCachedPointerInfo(Phi);
VN.erase(CurInst);
- DEBUG(cerr << "GVN PRE removed: " << *CurInst);
+ DEBUG(errs() << "GVN PRE removed: " << *CurInst);
MD->removeInstruction(CurInst);
CurInst->eraseFromParent();
DEBUG(verifyRemoved(CurInst));
#include "llvm/Support/CFG.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Streams.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cctype>
}
#if 0
-#define ST_DEBUG(X) cerr << X
+#define ST_DEBUG(X) errs() << X
#else
#define ST_DEBUG(X)
#endif
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LeakDetector.h"
-#include "llvm/Support/Streams.h"
using namespace llvm;
//===----------------------------------------------------------------------===//
#include "llvm/Support/CallSite.h"
#include "llvm/Support/ConstantRange.h"
#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Streams.h"
using namespace llvm;
//===----------------------------------------------------------------------===//