diff options
| author | Tobias Grosser <tobias@grosser.es> | 2015-12-17 12:55:26 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2015-12-17 12:55:26 +0000 |
| commit | eb2eebe486a4ed21508c5103e8d7e94a4964b714 (patch) | |
| tree | c8840d410e3b514cf1b1e4cb89072697f26fbc12 /polly/lib/Analysis | |
| parent | 71ebc691f66f7b407531d8899248995eadd8abac (diff) | |
| download | bcm5719-llvm-eb2eebe486a4ed21508c5103e8d7e94a4964b714.tar.gz bcm5719-llvm-eb2eebe486a4ed21508c5103e8d7e94a4964b714.zip | |
ScopGraphPrinter: Only show functions that contain at least one scop
When running 'clang -O3 -mllvm -polly -mllvm -polly-show' we now only show the
CFGs of functions with at least one detected scop. For larger files/projects
this reduces the number of graphs printed significantly and is likely what
developers want to see. The new option -polly-view-all enforces all graphs to be
printed and the exiting option -poll-view-only limites the graph printing to
functions that match a certain pattern.
This patch requires https://llvm.org/svn/llvm-project/llvm/trunk@255889 (and
vice versa) to compile correctly.
llvm-svn: 255891
Diffstat (limited to 'polly/lib/Analysis')
| -rw-r--r-- | polly/lib/Analysis/ScopGraphPrinter.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/polly/lib/Analysis/ScopGraphPrinter.cpp b/polly/lib/Analysis/ScopGraphPrinter.cpp index ba8d1443188..c37cf035c11 100644 --- a/polly/lib/Analysis/ScopGraphPrinter.cpp +++ b/polly/lib/Analysis/ScopGraphPrinter.cpp @@ -29,6 +29,11 @@ static cl::opt<std::string> cl::desc("Only view functions that match this pattern"), cl::Hidden, cl::init(""), cl::ZeroOrMore); +static cl::opt<bool> + ViewAll("polly-view-all", + cl::desc("Also show functions without any scops"), + cl::Hidden, cl::init(false), cl::ZeroOrMore); + namespace llvm { template <> struct GraphTraits<ScopDetection *> : public GraphTraits<RegionInfo *> { @@ -178,14 +183,15 @@ struct DOTGraphTraits<ScopDetection *> : public DOTGraphTraits<RegionNode *> { struct ScopViewer : public DOTGraphTraitsViewer<ScopDetection, false> { static char ID; ScopViewer() : DOTGraphTraitsViewer<ScopDetection, false>("scops", ID) {} - bool processFunction(Function &F) override { - if (ViewFilter == "") - return true; + bool processFunction(Function &F, ScopDetection &SD) override { + if (ViewFilter != "" && !F.getName().count(ViewFilter)) + return false; - if (F.getName().count(ViewFilter)) + if (ViewAll) return true; - return false; + // Check that at least one scop was detected. + return std::distance(SD.begin(), SD.end()) > 0; } }; char ScopViewer::ID = 0; |

