From 3ee8fc964952a65bcb3668b85938c46f90631e42 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 23 Sep 2008 12:47:39 +0000 Subject: Rationalize the names of passes that print information: -callgraph => print-callgraph -callscc => print-callgraph-sccs -cfgscc => print-cfg-sccs -externalfnconstants => print-externalfnconstants -print => print-function -print-alias-sets (no change) -print-callgraph => dot-callgraph -print-cfg => dot-cfg -print-cfg-only => dot-cfg-only -print-dom-info (no change) -printm => print-module -printusedtypes => print-used-types git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56487 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/Passes.html | 138 ++++++++++----------- lib/Analysis/CFGPrinter.cpp | 6 +- lib/Analysis/IPA/FindUsedTypes.cpp | 2 +- lib/VMCore/AsmWriter.cpp | 4 +- test/Analysis/CallGraph/2008-09-09-DirectCall.ll | 3 +- test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll | 3 +- test/Other/2002-01-31-CallGraph.ll | 2 +- test/Other/2007-06-05-PassID.ll | 2 +- test/Transforms/BlockPlacement/basictest.ll | 2 +- test/Transforms/Inline/basictest.ll | 2 +- test/Transforms/PruneEH/2008-09-05-CGUpdate.ll | 5 +- tools/opt/AnalysisWrappers.cpp | 5 +- tools/opt/GraphPrinters.cpp | 2 +- tools/opt/PrintSCC.cpp | 12 +- 14 files changed, 96 insertions(+), 92 deletions(-) diff --git a/docs/Passes.html b/docs/Passes.html index bb1a64bd97..22a73516cb 100644 --- a/docs/Passes.html +++ b/docs/Passes.html @@ -79,15 +79,14 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! -basicaaBasic Alias Analysis (default AA impl) -basiccgBasic CallGraph Construction -basicvnBasic Value Numbering (default GVN impl) --callgraphPrint a call graph --callsccPrint SCCs of the Call Graph --cfgsccPrint SCCs of each function CFG -codegenprepareOptimize for code generation -count-aaCount Alias Analysis Query Responses -debug-aaAA use debugger -domfrontierDominance Frontier Construction -domtreeDominator Tree Construction --externalfnconstantsPrint external fn callsites passed constants +-dot-callgraphPrint Call Graph to 'dot' file +-dot-cfgPrint CFG of function to 'dot' file +-dot-cfg-onlyPrint CFG of function to 'dot' file (with no function bodies) -globalsmodref-aaSimple mod/ref analysis for globals -instcountCounts the various types of Instructions -intervalsInterval Partition Construction @@ -98,13 +97,14 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! -no-profileNo Profile Information -postdomfrontierPost-Dominance Frontier Construction -postdomtreePost-Dominator Tree Construction --printPrint function to stderr -print-alias-setsAlias Set Printer --print-callgraphPrint Call Graph to 'dot' file --print-cfgPrint CFG of function to 'dot' file --print-cfg-onlyPrint CFG of function to 'dot' file (with no function bodies) --printmPrint module to stderr --printusedtypesFind Used Types +-print-callgraphPrint a call graph +-print-callgraph-sccsPrint SCCs of the Call Graph +-print-cfg-sccsPrint SCCs of each function CFG +-print-externalfnconstantsPrint external fn callsites passed constants +-print-functionPrint function to stderr +-print-modulePrint module to stderr +-print-used-typesFind Used Types -profile-loaderLoad profile information from llvmprof.out -scalar-evolutionScalar Evolution Analysis -targetdataTarget Data Layout @@ -315,39 +315,6 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

- -
- Print a call graph -
-
-

- This pass, only available in opt, prints the call graph to - standard output in a human-readable form. -

-
- - -
- Print SCCs of the Call Graph -
-
-

- This pass, only available in opt, prints the SCCs of the call - graph to standard output in a human-readable form. -

-
- - -
- Print SCCs of each function CFG -
-
-

- This pass, only available in opt, prints the SCCs of each - function CFG to standard output in a human-readable form. -

-
-
Optimize for code generation @@ -412,14 +379,38 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

- This pass, only available in opt, prints out call sites to - external functions that are called with constant arguments. This can be - useful when looking for standard library functions we should constant fold - or handle in alias analyses. + This pass, only available in opt, prints the call graph into a + .dot graph. This graph can then be processed with the "dot" tool + to convert it to postscript or some other suitable format. +

+
+ + + +
+

+ This pass, only available in opt, prints the control flow graph + into a .dot graph. This graph can then be processed with the + "dot" tool to convert it to postscript or some other suitable format. +

+
+ + + +
+

+ This pass, only available in opt, prints the control flow graph + into a .dot graph, omitting the function bodies. This graph can + then be processed with the "dot" tool to convert it to postscript or some + other suitable format.

@@ -557,64 +548,73 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

+
+

Yet to be written.

+
+ + +

- The PrintFunctionPass class is designed to be pipelined with - other FunctionPasses, and prints out the functions of the module - as they are processed. + This pass, only available in opt, prints the call graph to + standard output in a human-readable form.

-

Yet to be written.

+

+ This pass, only available in opt, prints the SCCs of the call + graph to standard output in a human-readable form. +

- This pass, only available in opt, prints the call graph into a - .dot graph. This graph can then be processed with the "dot" tool - to convert it to postscript or some other suitable format. + This pass, only available in opt, prints the SCCs of each + function CFG to standard output in a human-readable form.

- This pass, only available in opt, prints the control flow graph - into a .dot graph. This graph can then be processed with the - "dot" tool to convert it to postscript or some other suitable format. + This pass, only available in opt, prints out call sites to + external functions that are called with constant arguments. This can be + useful when looking for standard library functions we should constant fold + or handle in alias analyses.

- This pass, only available in opt, prints the control flow graph - into a .dot graph, omitting the function bodies. This graph can - then be processed with the "dot" tool to convert it to postscript or some - other suitable format. + The PrintFunctionPass class is designed to be pipelined with + other FunctionPasses, and prints out the functions of the module + as they are processed.

@@ -624,7 +624,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

diff --git a/lib/Analysis/CFGPrinter.cpp b/lib/Analysis/CFGPrinter.cpp index 46d3930bd6..143220ce38 100644 --- a/lib/Analysis/CFGPrinter.cpp +++ b/lib/Analysis/CFGPrinter.cpp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file defines a '-print-cfg' analysis pass, which emits the +// This file defines a '-dot-cfg' analysis pass, which emits the // cfg..dot file for each function in the program, with a graph of the // CFG for that function. // @@ -165,7 +165,7 @@ namespace { char CFGPrinter::ID = 0; static RegisterPass -P1("print-cfg", "Print CFG of function to 'dot' file", false, true); +P1("dot-cfg", "Print CFG of function to 'dot' file", false, true); namespace { struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter { @@ -188,7 +188,7 @@ namespace { char CFGOnlyPrinter::ID = 0; static RegisterPass -P2("print-cfg-only", +P2("dot-cfg-only", "Print CFG of function to 'dot' file (with no function bodies)", false, true); /// viewCFG - This function is meant for use from the debugger. You can just diff --git a/lib/Analysis/IPA/FindUsedTypes.cpp b/lib/Analysis/IPA/FindUsedTypes.cpp index c3b08debe6..88a180ae52 100644 --- a/lib/Analysis/IPA/FindUsedTypes.cpp +++ b/lib/Analysis/IPA/FindUsedTypes.cpp @@ -23,7 +23,7 @@ using namespace llvm; char FindUsedTypes::ID = 0; static RegisterPass -X("printusedtypes", "Find Used Types", false, true); +X("print-used-types", "Find Used Types", false, true); // IncorporateType - Incorporate one type and all of its subtypes into the // collection of used types. diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 1088236c10..ab8b59bc27 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -41,10 +41,10 @@ AssemblyAnnotationWriter::~AssemblyAnnotationWriter() {} char PrintModulePass::ID = 0; static RegisterPass -X("printm", "Print module to stderr"); +X("print-module", "Print module to stderr"); char PrintFunctionPass::ID = 0; static RegisterPass -Y("print","Print function to stderr"); +Y("print-function","Print function to stderr"); //===----------------------------------------------------------------------===// diff --git a/test/Analysis/CallGraph/2008-09-09-DirectCall.ll b/test/Analysis/CallGraph/2008-09-09-DirectCall.ll index a3afc379c5..456ffa25d7 100644 --- a/test/Analysis/CallGraph/2008-09-09-DirectCall.ll +++ b/test/Analysis/CallGraph/2008-09-09-DirectCall.ll @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | opt -callgraph -disable-output |& grep {Calls function 'callee'} | count 2 +; RUN: llvm-as < %s | opt -print-callgraph -disable-output |& \ +; RUN: grep {Calls function 'callee'} | count 2 define internal void @callee(...) { entry: diff --git a/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll b/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll index 8e6e5d2839..ffc27bbe43 100644 --- a/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll +++ b/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | opt -callgraph -disable-output |& grep {Calls function} +; RUN: llvm-as < %s | opt -print-callgraph -disable-output |& \ +; RUN: grep {Calls function} @a = global void ()* @f ; [#uses=0] diff --git a/test/Other/2002-01-31-CallGraph.ll b/test/Other/2002-01-31-CallGraph.ll index da638d8394..bb4c23e877 100644 --- a/test/Other/2002-01-31-CallGraph.ll +++ b/test/Other/2002-01-31-CallGraph.ll @@ -1,6 +1,6 @@ ; Call graph construction crash: Not handling indirect calls right ; -; RUN: llvm-as < %s | opt -analyze -callgraph >& /dev/null +; RUN: llvm-as < %s | opt -analyze -print-callgraph >& /dev/null ; %FunTy = type i32 (i32) diff --git a/test/Other/2007-06-05-PassID.ll b/test/Other/2007-06-05-PassID.ll index 81e9ef6f79..b6bba36c87 100644 --- a/test/Other/2007-06-05-PassID.ll +++ b/test/Other/2007-06-05-PassID.ll @@ -1,4 +1,4 @@ -;RUN: llvm-as < %s | opt -analyze -print-cfg-only -disable-output 2>/dev/null +;RUN: llvm-as < %s | opt -analyze -dot-cfg-only -disable-output 2>/dev/null ;PR 1497 define void @foo() { diff --git a/test/Transforms/BlockPlacement/basictest.ll b/test/Transforms/BlockPlacement/basictest.ll index e7755cf6eb..4eec23e49c 100644 --- a/test/Transforms/BlockPlacement/basictest.ll +++ b/test/Transforms/BlockPlacement/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -block-placement -disable-output -print 2> /dev/null +; RUN: llvm-as < %s | opt -block-placement -disable-output -print-function 2> /dev/null define i32 @test() { br i1 true, label %X, label %Y diff --git a/test/Transforms/Inline/basictest.ll b/test/Transforms/Inline/basictest.ll index 59cacb6193..d954238dab 100644 --- a/test/Transforms/Inline/basictest.ll +++ b/test/Transforms/Inline/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output -print 2> /dev/null +; RUN: llvm-as < %s | opt -inline -disable-output -print-function 2> /dev/null define i32 @func(i32 %i) { ret i32 %i diff --git a/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll b/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll index 828be7ac34..6e847fcfdc 100644 --- a/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll +++ b/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll @@ -1,5 +1,6 @@ -; RUN: llvm-as < %s | opt -prune-eh -inline -callgraph -disable-output |& \ -; RUN: grep {Calls.*ce3806g__fxio__put__put_int64__4.1339} | count 2 +; RUN: llvm-as < %s | opt -prune-eh -inline -print-callgraph \ +; RUN: -disable-output |& \ +; RUN: grep {Calls.*ce3806g__fxio__put__put_int64__4.1339} | count 2 %struct.FRAME.ce3806g = type { %struct.string___XUB, %struct.string___XUB, %struct.string___XUB, %struct.string___XUB } %struct.FRAME.ce3806g__fxio__put__4 = type { i32, i32, i32, %struct.system__file_control_block__pstring*, i32, i32, i8 } %struct.RETURN = type { i8, i32 } diff --git a/tools/opt/AnalysisWrappers.cpp b/tools/opt/AnalysisWrappers.cpp index 454e73872e..94cca50d63 100644 --- a/tools/opt/AnalysisWrappers.cpp +++ b/tools/opt/AnalysisWrappers.cpp @@ -65,7 +65,8 @@ namespace { char ExternalFunctionsPassedConstants::ID = 0; RegisterPass - P1("externalfnconstants", "Print external fn callsites passed constants"); + P1("print-externalfnconstants", + "Print external fn callsites passed constants"); struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid @@ -83,5 +84,5 @@ namespace { char CallGraphPrinter::ID = 0; RegisterPass - P2("callgraph", "Print a call graph"); + P2("print-callgraph", "Print a call graph"); } diff --git a/tools/opt/GraphPrinters.cpp b/tools/opt/GraphPrinters.cpp index 7f1199a1e3..31515c8993 100644 --- a/tools/opt/GraphPrinters.cpp +++ b/tools/opt/GraphPrinters.cpp @@ -79,7 +79,7 @@ namespace { }; char CallGraphPrinter::ID = 0; - RegisterPass P2("print-callgraph", + RegisterPass P2("dot-callgraph", "Print Call Graph to 'dot' file"); } diff --git a/tools/opt/PrintSCC.cpp b/tools/opt/PrintSCC.cpp index 0b9c12ff4b..f314baaba9 100644 --- a/tools/opt/PrintSCC.cpp +++ b/tools/opt/PrintSCC.cpp @@ -14,12 +14,12 @@ // // (1) As a reference for how to use the scc_iterator. // (2) To print out the SCCs for a CFG or a CallGraph: -// analyze -cfgscc to print the SCCs in each CFG of a module. -// analyze -cfgscc -stats to print the #SCCs and the maximum SCC size. -// analyze -cfgscc -debug > /dev/null to watch the algorithm in action. +// analyze -print-cfg-sccs to print the SCCs in each CFG of a module. +// analyze -print-cfg-sccs -stats to print the #SCCs and the maximum SCC size. +// analyze -print-cfg-sccs -debug > /dev/null to watch the algorithm in action. // // and similarly: -// analyze -callscc [-stats] [-debug] to print SCCs in the CallGraph +// analyze -print-callgraph-sccs [-stats] [-debug] to print SCCs in the CallGraph // // (3) To test the scc_iterator. // @@ -64,11 +64,11 @@ namespace { char CFGSCC::ID = 0; RegisterPass - Y("cfgscc", "Print SCCs of each function CFG"); + Y("print-cfg-sccs", "Print SCCs of each function CFG"); char CallGraphSCC::ID = 0; RegisterPass - Z("callscc", "Print SCCs of the Call Graph"); + Z("print-callgraph-sccs", "Print SCCs of the Call Graph"); } bool CFGSCC::runOnFunction(Function &F) { -- cgit v1.2.3