1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Move some warnings to debug mode.

llvm-svn: 30933
This commit is contained in:
Andrew Lenharth 2006-10-13 17:38:22 +00:00
parent 1f85e7a2a1
commit 254a2fbcd0
4 changed files with 23 additions and 21 deletions

View File

@ -171,11 +171,9 @@ bool BUDataStructures::runOnModule(Module &M) {
// Calculate the graphs for any functions that are unreachable from main... // Calculate the graphs for any functions that are unreachable from main...
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isExternal() && !DSInfo.count(I)) { if (!I->isExternal() && !DSInfo.count(I)) {
#ifndef NDEBUG
if (MainFunc) if (MainFunc)
std::cerr << "*** BU: Function unreachable from main: " DEBUG(std::cerr << "*** BU: Function unreachable from main: "
<< I->getName() << "\n"; << I->getName() << "\n");
#endif
calculateGraphs(I, Stack, NextID, ValMap); // Calculate all graphs. calculateGraphs(I, Stack, NextID, ValMap); // Calculate all graphs.
} }
@ -206,7 +204,7 @@ bool BUDataStructures::runOnModule(Module &M) {
BuildGlobalECs(*GlobalsGraph, ECGlobals); BuildGlobalECs(*GlobalsGraph, ECGlobals);
if (!ECGlobals.empty()) { if (!ECGlobals.empty()) {
NamedRegionTimer X("Bottom-UP EC Cleanup"); NamedRegionTimer X("Bottom-UP EC Cleanup");
std::cerr << "Eliminating " << ECGlobals.size() << " EC Globals!\n"; DEBUG(std::cerr << "Eliminating " << ECGlobals.size() << " EC Globals!\n");
for (hash_map<Function*, DSGraph*>::iterator I = DSInfo.begin(), for (hash_map<Function*, DSGraph*>::iterator I = DSInfo.begin(),
E = DSInfo.end(); I != E; ++I) E = DSInfo.end(); I != E; ++I)
EliminateUsesOfECGlobals(*I->second, ECGlobals); EliminateUsesOfECGlobals(*I->second, ECGlobals);
@ -237,11 +235,12 @@ bool BUDataStructures::runOnModule(Module &M) {
ee = MainGraph.afc_end(); ii != ee; ++ii) { ee = MainGraph.afc_end(); ii != ee; ++ii) {
std::vector<Function*> Funcs; std::vector<Function*> Funcs;
GetAllCallees(*ii, Funcs); GetAllCallees(*ii, Funcs);
std::cerr << "Lost site\n"; DEBUG(std::cerr << "Lost site\n");
DEBUG(ii->getCallSite().getInstruction()->dump());
for (std::vector<Function*>::iterator iif = Funcs.begin(), eef = Funcs.end(); for (std::vector<Function*>::iterator iif = Funcs.begin(), eef = Funcs.end();
iif != eef; ++iif) { iif != eef; ++iif) {
AddGlobalToNode(this, *ii, *iif); AddGlobalToNode(this, *ii, *iif);
std::cerr << "Adding\n"; DEBUG(std::cerr << "Adding\n");
ActualCallees.insert(std::make_pair(ii->getCallSite().getInstruction(), *iif)); ActualCallees.insert(std::make_pair(ii->getCallSite().getInstruction(), *iif));
} }
} }
@ -421,8 +420,8 @@ unsigned BUDataStructures::calculateGraphs(Function *F,
} }
Stack.pop_back(); Stack.pop_back();
std::cerr << "Calculating graph for SCC #: " << MyID << " of size: " DEBUG(std::cerr << "Calculating graph for SCC #: " << MyID << " of size: "
<< SCCSize << "\n"; << SCCSize << "\n");
// Compute the Max SCC Size. // Compute the Max SCC Size.
if (MaxSCC < SCCSize) if (MaxSCC < SCCSize)
@ -441,7 +440,7 @@ unsigned BUDataStructures::calculateGraphs(Function *F,
DEBUG(std::cerr << "MISSING REDO\n"); DEBUG(std::cerr << "MISSING REDO\n");
} }
std::cerr << "DONE with SCC #: " << MyID << "\n"; DEBUG(std::cerr << "DONE with SCC #: " << MyID << "\n");
// We never have to revisit "SCC" processed functions... // We never have to revisit "SCC" processed functions...
return MyID; return MyID;

View File

@ -52,16 +52,15 @@ bool CompleteBUDataStructures::runOnModule(Module &M) {
if (!MainFunc->isExternal()) if (!MainFunc->isExternal())
calculateSCCGraphs(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap); calculateSCCGraphs(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap);
} else { } else {
std::cerr << "CBU-DSA: No 'main' function found!\n"; DEBUG(std::cerr << "CBU-DSA: No 'main' function found!\n");
} }
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isExternal() && !DSInfo.count(I)) { if (!I->isExternal() && !DSInfo.count(I)) {
#ifndef NDEBUG if (MainFunc) {
if (MainFunc) DEBUG(std::cerr << "*** CBU: Function unreachable from main: "
std::cerr << "*** CBU: Function unreachable from main: " << I->getName() << "\n");
<< I->getName() << "\n"; }
#endif
calculateSCCGraphs(getOrCreateGraph(*I), Stack, NextID, ValMap); calculateSCCGraphs(getOrCreateGraph(*I), Stack, NextID, ValMap);
} }

View File

@ -544,6 +544,9 @@ void GraphBuilder::visitCallSite(CallSite CS) {
mergeWith(getValueDest(**(CS.arg_begin()))); mergeWith(getValueDest(**(CS.arg_begin())));
return; return;
case Intrinsic::vaend: case Intrinsic::vaend:
case Intrinsic::dbg_func_start:
case Intrinsic::dbg_region_end:
case Intrinsic::dbg_stoppoint:
return; // noop return; // noop
case Intrinsic::memcpy_i32: case Intrinsic::memcpy_i32:
case Intrinsic::memcpy_i64: case Intrinsic::memcpy_i64:
@ -1028,9 +1031,10 @@ void GraphBuilder::visitCallSite(CallSite CS) {
Warn = true; Warn = true;
break; break;
} }
if (Warn) if (Warn) {
std::cerr << "WARNING: Call to unknown external function '" DEBUG(std::cerr << "WARNING: Call to unknown external function '"
<< F->getName() << "' will cause pessimistic results!\n"; << F->getName() << "' will cause pessimistic results!\n");
}
} }
} }

View File

@ -371,8 +371,8 @@ void TDDataStructures::InlineCallersIntoGraph(DSGraph &DSG) {
// If we already have this graph, recycle it. // If we already have this graph, recycle it.
if (IndCallRecI != IndCallMap.end() && IndCallRecI->first == Callees) { if (IndCallRecI != IndCallMap.end() && IndCallRecI->first == Callees) {
std::cerr << " [TD] *** Reuse of indcall graph for " << Callees.size() DEBUG(std::cerr << " [TD] *** Reuse of indcall graph for " << Callees.size()
<< " callees!\n"; << " callees!\n");
IndCallGraph = IndCallRecI->second; IndCallGraph = IndCallRecI->second;
} else { } else {
// Otherwise, create a new DSGraph to represent this. // Otherwise, create a new DSGraph to represent this.