[llvm-commits] [poolalloc] r155781 - in /poolalloc/trunk: lib/DSA/Printer.cpp test/TEST.dsgraph.Makefile test/TEST.dsgraph.report
Will Dietz
wdietz2 at illinois.edu
Sat Apr 28 17:13:22 PDT 2012
Author: wdietz2
Date: Sat Apr 28 19:13:22 2012
New Revision: 155781
URL: http://llvm.org/viewvc/llvm-project?rev=155781&view=rev
Log:
Change meaning of -dont-print-ds to mean "don't create .dot files for graphs".
Update dsgraph test-suite target to use this option, as it can be rather
time-consuming and doesn't help in producing the test results.
While I'm at it, also fix regexp used to extract GlobGr column in the report.
Modified:
poolalloc/trunk/lib/DSA/Printer.cpp
poolalloc/trunk/test/TEST.dsgraph.Makefile
poolalloc/trunk/test/TEST.dsgraph.report
Modified: poolalloc/trunk/lib/DSA/Printer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Printer.cpp?rev=155781&r1=155780&r2=155781&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Printer.cpp (original)
+++ poolalloc/trunk/lib/DSA/Printer.cpp Sat Apr 28 19:13:22 2012
@@ -32,7 +32,7 @@
//
namespace {
cl::list<std::string> OnlyPrint("dsa-only-print", cl::ReallyHidden);
- cl::opt<bool> DontPrintAnything("dont-print-ds", cl::ReallyHidden);
+ cl::opt<bool> DontPrintGraphs("dont-print-ds", cl::ReallyHidden);
cl::opt<bool> LimitPrint("dsa-limit-print", cl::Hidden);
STATISTIC (MaxGraphSize , "Maximum graph size");
STATISTIC (NumFoldedNodes , "Number of folded nodes (in final graph)");
@@ -303,17 +303,22 @@
const std::string &GraphName) const {
std::string Filename = GraphName + ".dot";
O << "Writing '" << Filename << "'...";
- std::string Error;
- llvm::raw_fd_ostream F(Filename.c_str(), Error);
+ if (!DontPrintGraphs) {
+ std::string Error;
+ llvm::raw_fd_ostream F(Filename.c_str(), Error);
+
+ if (Error.size()) {
+ O << " error opening file for writing! " << Error << "\n";
+ return;
+ }
- if (!Error.size()) {
print(F);
- unsigned NumCalls = shouldUseAuxCalls() ?
- getAuxFunctionCalls().size() : getFunctionCalls().size();
- O << " [" << getGraphSize() << "+" << NumCalls << "]\n";
} else {
- O << " error opening file for writing! " << Error << "\n";
+ O << "(disabled by command-line flag)";
}
+ unsigned NumCalls = shouldUseAuxCalls() ?
+ getAuxFunctionCalls().size() : getFunctionCalls().size();
+ O << " [" << getGraphSize() << "+" << NumCalls << "]\n";
}
/// viewGraph - Emit a dot graph, run 'dot', run gv on the postscript file,
@@ -403,8 +408,8 @@
// print - Print out the analysis results...
void DataStructures::print(llvm::raw_ostream &O, const Module *M) const {
- if (DontPrintAnything) return;
if (handleTest(O, M)) return;
+
printCollection(*this, O, M, printname);
//dumpCallGraph();
}
Modified: poolalloc/trunk/test/TEST.dsgraph.Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.dsgraph.Makefile?rev=155781&r1=155780&r2=155781&view=diff
==============================================================================
--- poolalloc/trunk/test/TEST.dsgraph.Makefile (original)
+++ poolalloc/trunk/test/TEST.dsgraph.Makefile Sat Apr 28 19:13:22 2012
@@ -24,7 +24,7 @@
PASS := td
ANALYZE_OPTS := -stats -time-passes -dsstats
-ANALYZE_OPTS += -instcount -disable-verify -analyze
+ANALYZE_OPTS += -instcount -disable-verify -analyze -dont-print-ds
MEM := -track-memory -time-passes -disable-output
#TYPE_INFERENCE_OPT := 1
Modified: poolalloc/trunk/test/TEST.dsgraph.report
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.dsgraph.report?rev=155781&r1=155780&r2=155781&view=diff
==============================================================================
--- poolalloc/trunk/test/TEST.dsgraph.report (original)
+++ poolalloc/trunk/test/TEST.dsgraph.report Sat Apr 28 19:13:22 2012
@@ -153,7 +153,7 @@
["NumNodes", "TOTALNODES: *([0-9]+)"],
["NumFold", "FOLDEDNODES: *([0-9]+)"],
["MaxSz" , "MAXGRAPHSIZE: *([0-9]+)"],
- ["GlobGr" , "GLOBALSGRAPH: *([0-9]+)"],
+ ["GlobGr" , "GLOBALSGRAPH: .*\\[([0-9]+)\+"],
["MaxSCC" , "SCCSIZE: *([0-9]+)"],
[],
# Nodes Folded
More information about the llvm-commits
mailing list