aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/MachineDebugInfo.cpp196
-rw-r--r--lib/CodeGen/RegAllocLocal.cpp2
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp32
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp9
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAG.cpp48
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp17
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp31
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp30
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp86
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp25
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp21
11 files changed, 242 insertions, 255 deletions
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp
index 48db413d53..bc75ccb7a6 100644
--- a/lib/CodeGen/MachineDebugInfo.cpp
+++ b/lib/CodeGen/MachineDebugInfo.cpp
@@ -21,9 +21,7 @@
#include "llvm/Instructions.h"
#include "llvm/Module.h"
#include "llvm/Support/Dwarf.h"
-
-#include <iostream>
-
+#include "llvm/Support/Streams.h"
using namespace llvm;
using namespace llvm::dwarf;
@@ -589,10 +587,10 @@ const char *AnchorDesc::getTypeString() const {
#ifndef NDEBUG
void AnchorDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "AnchorTag(" << AnchorTag << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "AnchorTag(" << AnchorTag << ")\n";
}
#endif
@@ -664,14 +662,14 @@ const char *CompileUnitDesc::getAnchorString() const {
#ifndef NDEBUG
void CompileUnitDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Anchor(" << getAnchor() << "), "
- << "Language(" << Language << "), "
- << "FileName(\"" << FileName << "\"), "
- << "Directory(\"" << Directory << "\"), "
- << "Producer(\"" << Producer << "\")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Anchor(" << getAnchor() << "), "
+ << "Language(" << Language << "), "
+ << "FileName(\"" << FileName << "\"), "
+ << "Directory(\"" << Directory << "\"), "
+ << "Producer(\"" << Producer << "\")\n";
}
#endif
@@ -718,17 +716,17 @@ const char *TypeDesc::getTypeString() const {
#ifndef NDEBUG
void TypeDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << Context << "), "
- << "Name(\"" << Name << "\"), "
- << "File(" << File << "), "
- << "Line(" << Line << "), "
- << "Size(" << Size << "), "
- << "Align(" << Align << "), "
- << "Offset(" << Offset << "), "
- << "Flags(" << Flags << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Context(" << Context << "), "
+ << "Name(\"" << Name << "\"), "
+ << "File(" << File << "), "
+ << "Line(" << Line << "), "
+ << "Size(" << Size << "), "
+ << "Align(" << Align << "), "
+ << "Offset(" << Offset << "), "
+ << "Flags(" << Flags << ")\n";
}
#endif
@@ -766,13 +764,13 @@ const char *BasicTypeDesc::getTypeString() const {
#ifndef NDEBUG
void BasicTypeDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << getContext() << "), "
- << "Name(\"" << getName() << "\"), "
- << "Size(" << getSize() << "), "
- << "Encoding(" << Encoding << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Context(" << getContext() << "), "
+ << "Name(\"" << getName() << "\"), "
+ << "Size(" << getSize() << "), "
+ << "Encoding(" << Encoding << ")\n";
}
#endif
@@ -823,15 +821,15 @@ const char *DerivedTypeDesc::getTypeString() const {
#ifndef NDEBUG
void DerivedTypeDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << getContext() << "), "
- << "Name(\"" << getName() << "\"), "
- << "Size(" << getSize() << "), "
- << "File(" << getFile() << "), "
- << "Line(" << getLine() << "), "
- << "FromType(" << FromType << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Context(" << getContext() << "), "
+ << "Name(\"" << getName() << "\"), "
+ << "Size(" << getSize() << "), "
+ << "File(" << getFile() << "), "
+ << "Line(" << getLine() << "), "
+ << "FromType(" << FromType << ")\n";
}
#endif
@@ -880,16 +878,16 @@ const char *CompositeTypeDesc::getTypeString() const {
#ifndef NDEBUG
void CompositeTypeDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << getContext() << "), "
- << "Name(\"" << getName() << "\"), "
- << "Size(" << getSize() << "), "
- << "File(" << getFile() << "), "
- << "Line(" << getLine() << "), "
- << "FromType(" << getFromType() << "), "
- << "Elements.size(" << Elements.size() << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Context(" << getContext() << "), "
+ << "Name(\"" << getName() << "\"), "
+ << "Size(" << getSize() << "), "
+ << "File(" << getFile() << "), "
+ << "Line(" << getLine() << "), "
+ << "FromType(" << getFromType() << "), "
+ << "Elements.size(" << Elements.size() << ")\n";
}
#endif
@@ -929,11 +927,11 @@ const char *SubrangeDesc::getTypeString() const {
#ifndef NDEBUG
void SubrangeDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Lo(" << Lo << "), "
- << "Hi(" << Hi << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Lo(" << Lo << "), "
+ << "Hi(" << Hi << ")\n";
}
#endif
@@ -973,11 +971,11 @@ const char *EnumeratorDesc::getTypeString() const {
#ifndef NDEBUG
void EnumeratorDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Name(" << Name << "), "
- << "Value(" << Value << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Name(" << Name << "), "
+ << "Value(" << Value << ")\n";
}
#endif
@@ -1031,14 +1029,14 @@ const char *VariableDesc::getTypeString() const {
#ifndef NDEBUG
void VariableDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << Context << "), "
- << "Name(\"" << Name << "\"), "
- << "File(" << File << "), "
- << "Line(" << Line << "), "
- << "TyDesc(" << TyDesc << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Context(" << Context << "), "
+ << "Name(\"" << Name << "\"), "
+ << "File(" << File << "), "
+ << "Line(" << Line << "), "
+ << "TyDesc(" << TyDesc << ")\n";
}
#endif
@@ -1114,19 +1112,19 @@ const char *GlobalVariableDesc::getAnchorString() const {
#ifndef NDEBUG
void GlobalVariableDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Anchor(" << getAnchor() << "), "
- << "Name(\"" << getName() << "\"), "
- << "FullName(\"" << getFullName() << "\"), "
- << "LinkageName(\"" << getLinkageName() << "\"), "
- << "File(" << getFile() << "),"
- << "Line(" << getLine() << "),"
- << "Type(" << getType() << "), "
- << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
- << "IsDefinition(" << (isDefinition() ? "true" : "false") << "), "
- << "Global(" << Global << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Anchor(" << getAnchor() << "), "
+ << "Name(\"" << getName() << "\"), "
+ << "FullName(\"" << getFullName() << "\"), "
+ << "LinkageName(\"" << getLinkageName() << "\"), "
+ << "File(" << getFile() << "),"
+ << "Line(" << getLine() << "),"
+ << "Type(" << getType() << "), "
+ << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
+ << "IsDefinition(" << (isDefinition() ? "true" : "false") << "), "
+ << "Global(" << Global << ")\n";
}
#endif
@@ -1168,18 +1166,18 @@ const char *SubprogramDesc::getAnchorString() const {
#ifndef NDEBUG
void SubprogramDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Anchor(" << getAnchor() << "), "
- << "Name(\"" << getName() << "\"), "
- << "FullName(\"" << getFullName() << "\"), "
- << "LinkageName(\"" << getLinkageName() << "\"), "
- << "File(" << getFile() << "),"
- << "Line(" << getLine() << "),"
- << "Type(" << getType() << "), "
- << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
- << "IsDefinition(" << (isDefinition() ? "true" : "false") << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Anchor(" << getAnchor() << "), "
+ << "Name(\"" << getName() << "\"), "
+ << "FullName(\"" << getFullName() << "\"), "
+ << "LinkageName(\"" << getLinkageName() << "\"), "
+ << "File(" << getFile() << "),"
+ << "Line(" << getLine() << "),"
+ << "Type(" << getType() << "), "
+ << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
+ << "IsDefinition(" << (isDefinition() ? "true" : "false") << ")\n";
}
#endif
@@ -1217,10 +1215,10 @@ const char *BlockDesc::getTypeString() const {
#ifndef NDEBUG
void BlockDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "),"
- << "Context(" << Context << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "),"
+ << "Context(" << Context << ")\n";
}
#endif
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp
index 8d10ff703b..876eb950d9 100644
--- a/lib/CodeGen/RegAllocLocal.cpp
+++ b/lib/CodeGen/RegAllocLocal.cpp
@@ -758,7 +758,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) {
for (unsigned i = MRegisterInfo::FirstVirtualRegister,
e = MF->getSSARegMap()->getLastVirtReg(); i <= e; ++i)
if (unsigned PR = Virt2PhysRegMap[i]) {
- std::cerr << "Register still mapped: " << i << " -> " << PR << "\n";
+ cerr << "Register still mapped: " << i << " -> " << PR << "\n";
AllOk = false;
}
assert(AllOk && "Virtual registers still in phys regs?");
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 2f8ad80e5c..b8439a62be 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -38,8 +38,6 @@
#include "llvm/Support/Compiler.h"
#include "llvm/Support/CommandLine.h"
#include <algorithm>
-#include <iostream>
-#include <algorithm>
using namespace llvm;
namespace {
@@ -101,9 +99,9 @@ namespace {
bool AddTo = true) {
assert(N->getNumValues() == NumTo && "Broken CombineTo call!");
++NodesCombined;
- DEBUG(std::cerr << "\nReplacing.1 "; N->dump();
- std::cerr << "\nWith: "; To[0].Val->dump(&DAG);
- std::cerr << " and " << NumTo-1 << " other values\n");
+ DOUT << "\nReplacing.1 "; DEBUG(N->dump());
+ DOUT << "\nWith: "; DEBUG(To[0].Val->dump(&DAG));
+ DOUT << " and " << NumTo-1 << " other values\n";
std::vector<SDNode*> NowDead;
DAG.ReplaceAllUsesWith(N, To, &NowDead);
@@ -152,9 +150,9 @@ namespace {
// Replace the old value with the new one.
++NodesCombined;
- DEBUG(std::cerr << "\nReplacing.2 "; TLO.Old.Val->dump();
- std::cerr << "\nWith: "; TLO.New.Val->dump(&DAG);
- std::cerr << '\n');
+ DOUT << "\nReplacing.2 "; DEBUG(TLO.Old.Val->dump());
+ DOUT << "\nWith: "; DEBUG(TLO.New.Val->dump(&DAG));
+ DOUT << '\n';
std::vector<SDNode*> NowDead;
DAG.ReplaceAllUsesOfValueWith(TLO.Old, TLO.New, NowDead);
@@ -455,9 +453,9 @@ void DAGCombiner::Run(bool RunningAfterLegalize) {
RV.Val->getOpcode() != ISD::DELETED_NODE &&
"Node was deleted but visit returned new node!");
- DEBUG(std::cerr << "\nReplacing.3 "; N->dump();
- std::cerr << "\nWith: "; RV.Val->dump(&DAG);
- std::cerr << '\n');
+ DOUT << "\nReplacing.3 "; DEBUG(N->dump());
+ DOUT << "\nWith: "; DEBUG(RV.Val->dump(&DAG));
+ DOUT << '\n';
std::vector<SDNode*> NowDead;
if (N->getNumValues() == RV.Val->getNumValues())
DAG.ReplaceAllUsesWith(N, RV.Val, &NowDead);
@@ -2801,9 +2799,9 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
Result = DAG.getIndexedStore(SDOperand(N,0), BasePtr, Offset, AM);
++PreIndexedNodes;
++NodesCombined;
- DEBUG(std::cerr << "\nReplacing.4 "; N->dump();
- std::cerr << "\nWith: "; Result.Val->dump(&DAG);
- std::cerr << '\n');
+ DOUT << "\nReplacing.4 "; DEBUG(N->dump());
+ DOUT << "\nWith: "; DEBUG(Result.Val->dump(&DAG));
+ DOUT << '\n';
std::vector<SDNode*> NowDead;
if (isLoad) {
DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Result.getValue(0),
@@ -2924,9 +2922,9 @@ bool DAGCombiner::CombineToPostIndexedLoadStore(SDNode *N) {
: DAG.getIndexedStore(SDOperand(N,0), BasePtr, Offset, AM);
++PostIndexedNodes;
++NodesCombined;
- DEBUG(std::cerr << "\nReplacing.5 "; N->dump();
- std::cerr << "\nWith: "; Result.Val->dump(&DAG);
- std::cerr << '\n');
+ DOUT << "\nReplacing.5 "; DEBUG(N->dump());
+ DOUT << "\nWith: "; DEBUG(Result.Val->dump(&DAG));
+ DOUT << '\n';
std::vector<SDNode*> NowDead;
if (isLoad) {
DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Result.getValue(0),
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index bf467b733d..0d8ca7bd2e 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -24,7 +24,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/ADT/SmallVector.h"
-#include <iostream>
#include <map>
using namespace llvm;
@@ -556,7 +555,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
}
// Otherwise this is an unhandled builtin node. splat.
#ifndef NDEBUG
- std::cerr << "NODE: "; Node->dump(); std::cerr << "\n";
+ cerr << "NODE: "; Node->dump(); cerr << "\n";
#endif
assert(0 && "Do not know how to legalize this operator!");
abort();
@@ -2975,7 +2974,7 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
assert(0 && "CopyFromReg must be legal!");
default:
#ifndef NDEBUG
- std::cerr << "NODE: "; Node->dump(); std::cerr << "\n";
+ cerr << "NODE: "; Node->dump(); cerr << "\n";
#endif
assert(0 && "Do not know how to promote this operator!");
abort();
@@ -4371,7 +4370,7 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
assert(0 && "CopyFromReg must be legal!");
default:
#ifndef NDEBUG
- std::cerr << "NODE: "; Node->dump(); std::cerr << "\n";
+ cerr << "NODE: "; Node->dump(); cerr << "\n";
#endif
assert(0 && "Do not know how to expand this operator!");
abort();
@@ -5020,7 +5019,7 @@ SDOperand SelectionDAGLegalize::PackVectorOp(SDOperand Op,
switch (Node->getOpcode()) {
default:
#ifndef NDEBUG
- Node->dump(); std::cerr << "\n";
+ Node->dump(); cerr << "\n";
#endif
assert(0 && "Unknown vector operation in PackVectorOp!");
case ISD::VADD:
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index 42b587f46c..d5448055a8 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -24,10 +24,8 @@
#include "llvm/Target/TargetLowering.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
-#include <iostream>
using namespace llvm;
-
/// BuildSchedUnits - Build SUnits from the selection dag that we are input.
/// This SUnit graph is similar to the SelectionDAG, but represents flagged
/// together nodes with a single SUnit.
@@ -430,9 +428,9 @@ void ScheduleDAG::EmitNode(SDNode *Node,
if (CommuteSet.count(Node)) {
MachineInstr *NewMI = TII->commuteInstruction(MI);
if (NewMI == 0)
- DEBUG(std::cerr << "Sched: COMMUTING FAILED!\n");
+ DOUT << "Sched: COMMUTING FAILED!\n";
else {
- DEBUG(std::cerr << "Sched: COMMUTED TO: " << *NewMI);
+ DOUT << "Sched: COMMUTED TO: " << *NewMI;
if (MI != NewMI) {
delete MI;
MI = NewMI;
@@ -614,7 +612,7 @@ void ScheduleDAG::dumpSchedule() const {
if (SUnit *SU = Sequence[i])
SU->dump(&DAG);
else
- std::cerr << "**** NOOP ****\n";
+ cerr << "**** NOOP ****\n";
}
}
@@ -634,14 +632,14 @@ MachineBasicBlock *ScheduleDAG::Run() {
/// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
/// a group of nodes flagged together.
void SUnit::dump(const SelectionDAG *G) const {
- std::cerr << "SU(" << NodeNum << "): ";
+ cerr << "SU(" << NodeNum << "): ";
Node->dump(G);
- std::cerr << "\n";
+ cerr << "\n";
if (FlaggedNodes.size() != 0) {
for (unsigned i = 0, e = FlaggedNodes.size(); i != e; i++) {
- std::cerr << " ";
+ cerr << " ";
FlaggedNodes[i]->dump(G);
- std::cerr << "\n";
+ cerr << "\n";
}
}
}
@@ -649,35 +647,35 @@ void SUnit::dump(const SelectionDAG *G) const {
void SUnit::dumpAll(const SelectionDAG *G) const {
dump(G);
- std::cerr << " # preds left : " << NumPredsLeft << "\n";
- std::cerr << " # succs left : " << NumSuccsLeft << "\n";
- std::cerr << " # chain preds left : " << NumChainPredsLeft << "\n";
- std::cerr << " # chain succs left : " << NumChainSuccsLeft << "\n";
- std::cerr << " Latency : " << Latency << "\n";
- std::cerr << " Depth : " << Depth << "\n";
- std::cerr << " Height : " << Height << "\n";
+ cerr << " # preds left : " << NumPredsLeft << "\n";
+ cerr << " # succs left : " << NumSuccsLeft << "\n";
+ cerr << " # chain preds left : " << NumChainPredsLeft << "\n";
+ cerr << " # chain succs left : " << NumChainSuccsLeft << "\n";
+ cerr << " Latency : " << Latency << "\n";
+ cerr << " Depth : " << Depth << "\n";
+ cerr << " Height : " << Height << "\n";
if (Preds.size() != 0) {
- std::cerr << " Predecessors:\n";
+ cerr << " Predecessors:\n";
for (SUnit::const_succ_iterator I = Preds.begin(), E = Preds.end();
I != E; ++I) {
if (I->second)
- std::cerr << " ch #";
+ cerr << " ch #";
else
- std::cerr << " val #";
- std::cerr << I->first << " - SU(" << I->first->NodeNum << ")\n";
+ cerr << " val #";
+ cerr << I->first << " - SU(" << I->first->NodeNum << ")\n";
}
}
if (Succs.size() != 0) {
- std::cerr << " Successors:\n";
+ cerr << " Successors:\n";
for (SUnit::const_succ_iterator I = Succs.begin(), E = Succs.end();
I != E; ++I) {
if (I->second)
- std::cerr << " ch #";
+ cerr << " ch #";
else
- std::cerr << " val #";
- std::cerr << I->first << " - SU(" << I->first->NodeNum << ")\n";
+ cerr << " val #";
+ cerr << I->first << " - SU(" << I->first->NodeNum << ")\n";
}
}
- std::cerr << "\n";
+ cerr << "\n";
}
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
index 2d08cbabb5..401b0249db 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
@@ -31,7 +31,6 @@
#include "llvm/Support/Compiler.h"
#include "llvm/ADT/Statistic.h"
#include <climits>
-#include <iostream>
#include <queue>
using namespace llvm;
@@ -93,7 +92,7 @@ HazardRecognizer::~HazardRecognizer() {}
/// Schedule - Schedule the DAG using list scheduling.
void ScheduleDAGList::Schedule() {
- DEBUG(std::cerr << "********** List Scheduling **********\n");
+ DOUT << "********** List Scheduling **********\n";
// Build scheduling units.
BuildSchedUnits();
@@ -104,9 +103,9 @@ void ScheduleDAGList::Schedule() {
AvailableQueue->releaseState();
- DEBUG(std::cerr << "*** Final schedule ***\n");
+ DOUT << "*** Final schedule ***\n";
DEBUG(dumpSchedule());
- DEBUG(std::cerr << "\n");
+ DOUT << "\n";
// Emit in scheduled order
EmitSchedule();
@@ -155,7 +154,7 @@ void ScheduleDAGList::ReleaseSucc(SUnit *SuccSU, bool isChain) {
/// count of its successors. If a successor pending count is zero, add it to
/// the Available queue.
void ScheduleDAGList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
- DEBUG(std::cerr << "*** Scheduling [" << CurCycle << "]: ");
+ DOUT << "*** Scheduling [" << CurCycle << "]: ";
DEBUG(SU->dump(&DAG));
Sequence.push_back(SU);
@@ -259,7 +258,7 @@ void ScheduleDAGList::ListScheduleTopDown() {
} else if (!HasNoopHazards) {
// Otherwise, we have a pipeline stall, but no other problem, just advance
// the current cycle and try again.
- DEBUG(std::cerr << "*** Advancing cycle, no work to do\n");
+ DOUT << "*** Advancing cycle, no work to do\n";
HazardRec->AdvanceCycle();
++NumStalls;
++CurCycle;
@@ -267,7 +266,7 @@ void ScheduleDAGList::ListScheduleTopDown() {
// Otherwise, we have no instructions to issue and we have instructions
// that will fault if we don't do this right. This is the case for
// processors without pipeline interlocks and other cases.
- DEBUG(std::cerr << "*** Emitting noop\n");
+ DOUT << "*** Emitting noop\n";
HazardRec->EmitNoop();
Sequence.push_back(0); // NULL SUnit* -> noop
++NumNoops;
@@ -281,9 +280,9 @@ void ScheduleDAGList::ListScheduleTopDown() {
for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
if (SUnits[i].NumPredsLeft != 0 || SUnits[i].NumChainPredsLeft != 0) {
if (!AnyNotSched)
- std::cerr << "*** List scheduling failed! ***\n";
+ cerr << "*** List scheduling failed! ***\n";
SUnits[i].dump(&DAG);
- std::cerr << "has not been scheduled!\n";
+ cerr << "has not been scheduled!\n";
AnyNotSched = true;
}
}
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
index e0a049903c..2ae0c36116 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
@@ -27,7 +27,6 @@
#include "llvm/Support/Compiler.h"
#include "llvm/ADT/Statistic.h"
#include <climits>
-#include <iostream>
#include <queue>
#include "llvm/Support/CommandLine.h"
using namespace llvm;
@@ -85,7 +84,7 @@ private:
/// Schedule - Schedule the DAG using list scheduling.
void ScheduleDAGRRList::Schedule() {
- DEBUG(std::cerr << "********** List Scheduling **********\n");
+ DOUT << "********** List Scheduling **********\n";
// Build scheduling units.
BuildSchedUnits();
@@ -107,9 +106,9 @@ void ScheduleDAGRRList::Schedule() {
CommuteNodesToReducePressure();
- DEBUG(std::cerr << "*** Final schedule ***\n");
+ DOUT << "*** Final schedule ***\n";
DEBUG(dumpSchedule());
- DEBUG(std::cerr << "\n");
+ DOUT << "\n";
// Emit in scheduled order
EmitSchedule();
@@ -186,9 +185,9 @@ void ScheduleDAGRRList::ReleasePred(SUnit *PredSU, bool isChain,
#ifndef NDEBUG
if (PredSU->NumSuccsLeft < 0 || PredSU->NumChainSuccsLeft < 0) {
- std::cerr << "*** List scheduling failed! ***\n";
+ cerr << "*** List scheduling failed! ***\n";
PredSU->dump(&DAG);
- std::cerr << " has been released too many times!\n";
+ cerr << " has been released too many times!\n";
assert(0);
}
#endif
@@ -206,7 +205,7 @@ void ScheduleDAGRRList::ReleasePred(SUnit *PredSU, bool isChain,
/// count of its predecessors. If a predecessor pending count is zero, add it to
/// the Available queue.
void ScheduleDAGRRList::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) {
- DEBUG(std::cerr << "*** Scheduling [" << CurCycle << "]: ");
+ DOUT << "*** Scheduling [" << CurCycle << "]: ";
DEBUG(SU->dump(&DAG));
SU->Cycle = CurCycle;
@@ -268,9 +267,9 @@ void ScheduleDAGRRList::ListScheduleBottomUp() {
for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
if (SUnits[i].NumSuccsLeft != 0 || SUnits[i].NumChainSuccsLeft != 0) {
if (!AnyNotSched)
- std::cerr << "*** List scheduling failed! ***\n";
+ cerr << "*** List scheduling failed! ***\n";
SUnits[i].dump(&DAG);
- std::cerr << "has not been scheduled!\n";
+ cerr << "has not been scheduled!\n";
AnyNotSched = true;
}
}
@@ -299,9 +298,9 @@ void ScheduleDAGRRList::ReleaseSucc(SUnit *SuccSU, bool isChain,
#ifndef NDEBUG
if (SuccSU->NumPredsLeft < 0 || SuccSU->NumChainPredsLeft < 0) {
- std::cerr << "*** List scheduling failed! ***\n";
+ cerr << "*** List scheduling failed! ***\n";
SuccSU->dump(&DAG);
- std::cerr << " has been released too many times!\n";
+ cerr << " has been released too many times!\n";
assert(0);
}
#endif
@@ -317,7 +316,7 @@ void ScheduleDAGRRList::ReleaseSucc(SUnit *SuccSU, bool isChain,
/// count of its successors. If a successor pending count is zero, add it to
/// the Available queue.
void ScheduleDAGRRList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
- DEBUG(std::cerr << "*** Scheduling [" << CurCycle << "]: ");
+ DOUT << "*** Scheduling [" << CurCycle << "]: ";
DEBUG(SU->dump(&DAG));
SU->Cycle = CurCycle;
@@ -374,9 +373,9 @@ void ScheduleDAGRRList::ListScheduleTopDown() {
for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
if (!SUnits[i].isScheduled) {
if (!AnyNotSched)
- std::cerr << "*** List scheduling failed! ***\n";
+ cerr << "*** List scheduling failed! ***\n";
SUnits[i].dump(&DAG);
- std::cerr << "has not been scheduled!\n";
+ cerr << "has not been scheduled!\n";
AnyNotSched = true;
}
}
@@ -707,8 +706,8 @@ void BURegReductionPriorityQueue<SF>::AddPseudoTwoAddrDeps() {
(!canClobber(SuccSU, DUSU) ||
(!SU->isCommutable && SuccSU->isCommutable))){
if (SuccSU->Depth == SU->Depth && !isReachable(SuccSU, SU)) {
- DEBUG(std::cerr << "Adding an edge from SU # " << SU->NodeNum
- << " to SU #" << SuccSU->NodeNum << "\n");
+ DOUT << "Adding an edge from SU # " << SU->NodeNum
+ << " to SU #" << SuccSU->NodeNum << "\n";
if (SU->addPred(SuccSU, true))
SU->NumChainPredsLeft++;
if (SuccSU->addSucc(SU, true))
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
index f48f4447ba..f64e65eafa 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
@@ -25,10 +25,8 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/Compiler.h"
#include <algorithm>
-#include <iostream>
using namespace llvm;
-
namespace {
static RegisterScheduler
@@ -475,7 +473,7 @@ private:
/// print - Print ordering to specified output stream.
///
- void print(std::ostream &O) const;
+ void print(OStream &O) const;
void dump(const char *tag) const;
@@ -487,7 +485,7 @@ private:
/// printNI - Print node info.
///
- void printNI(std::ostream &O, NodeInfo *NI) const;
+ void printNI(OStream &O, NodeInfo *NI) const;
/// printChanges - Hilight changes in order caused by scheduling.
///
@@ -638,7 +636,7 @@ void ScheduleDAGSimple::AddToGroup(NodeInfo *D, NodeInfo *U) {
/// print - Print ordering to specified output stream.
///
-void ScheduleDAGSimple::print(std::ostream &O) const {
+void ScheduleDAGSimple::print(OStream &O) const {
#ifndef NDEBUG
O << "Ordering\n";
for (unsigned i = 0, N = Ordering.size(); i < N; i++) {
@@ -659,11 +657,11 @@ void ScheduleDAGSimple::print(std::ostream &O) const {
}
void ScheduleDAGSimple::dump(const char *tag) const {
- std::cerr << tag; dump();
+ cerr << tag; dump();
}</