summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/LegacyPassManager.cpp
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-06-13 20:09:59 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-06-13 20:09:59 +0000
commitfbd450b052427fc603db47540b77d712fede8d93 (patch)
treec229ffecdc0677b911c69defc038ece00ec1bb58 /llvm/lib/IR/LegacyPassManager.cpp
parentf7f663e0a98b0c899e4255043c04ce14f0ea6e88 (diff)
downloadbcm5719-llvm-fbd450b052427fc603db47540b77d712fede8d93.tar.gz
bcm5719-llvm-fbd450b052427fc603db47540b77d712fede8d93.zip
[Timers] Use the pass argument name for JSON keys in time-passes
When using clang --save-stats -mllvm -time-passes, both timers and stats end up in the same json file. We could end up with things like: { "asm-printer.EmittedInsts": 1, "time.pass.Virtual Register Map.wall": 2.9015541076660156e-04, "time.pass.Virtual Register Map.user": 2.0500000000000379e-04, "time.pass.Virtual Register Map.sys": 8.5000000000001741e-05, } This patch makes use of the pass argument name (if available) in the JSON key to end up with things like: { "asm-printer.EmittedInsts": 1, "time.pass.virtregmap.wall": 2.9015541076660156e-04, "time.pass.virtregmap.user": 2.0500000000000379e-04, "time.pass.virtregmap.sys": 8.5000000000001741e-05, } This also helps avoiding to write another JSON printer to handle all the cases that we could have in our pass names. Differential Revision: https://reviews.llvm.org/D48109 llvm-svn: 334649
Diffstat (limited to 'llvm/lib/IR/LegacyPassManager.cpp')
-rw-r--r--llvm/lib/IR/LegacyPassManager.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp
index b04787cb30e..46bfba7f5a0 100644
--- a/llvm/lib/IR/LegacyPassManager.cpp
+++ b/llvm/lib/IR/LegacyPassManager.cpp
@@ -545,7 +545,11 @@ public:
Timer *&T = TimingData[P];
if (!T) {
StringRef PassName = P->getPassName();
- T = new Timer(PassName, PassName, TG);
+ StringRef PassArgument;
+ if (const PassInfo *PI = Pass::lookupPassInfo(P->getPassID()))
+ PassArgument = PI->getPassArgument();
+ T = new Timer(PassArgument.empty() ? PassName : PassArgument, PassName,
+ TG);
}
return T;
}
OpenPOWER on IntegriCloud