llvm.org GIT mirror llvm / 68d5d59
Reland: [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. Fixed test instead of adding a new one originally from r334649. Differential Revision: https://reviews.llvm.org/D48109 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334657 91177308-0d34-0410-b5e6-96231b3b80d8 Francis Visoiu Mistrih 1 year, 3 months ago
2 changed file(s) with 8 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
544544 Timer *&T = TimingData[P];
545545 if (!T) {
546546 StringRef PassName = P->getPassName();
547 T = new Timer(PassName, PassName, TG);
547 StringRef PassArgument;
548 if (const PassInfo *PI = Pass::lookupPassInfo(P->getPassID()))
549 PassArgument = PI->getPassArgument();
550 T = new Timer(PassArgument.empty() ? PassName : PassArgument, PassName,
551 TG);
548552 }
549553 return T;
550554 }
77
88 ; JSON: {
99 ; JSON-DAG: "instsimplify.NumSimplified": 1
10 ; JSONTIME-DAG: "time.pass.Remove redundant instructions.wall"
11 ; JSONTIME-DAG: "time.pass.Remove redundant instructions.user"
12 ; JSONTIME-DAG: "time.pass.Remove redundant instructions.sys"
10 ; JSONTIME-DAG: "time.pass.instsimplify.wall"
11 ; JSONTIME-DAG: "time.pass.instsimplify.user"
12 ; JSONTIME-DAG: "time.pass.instsimplify.sys"
1313 ; JSON: }
1414
1515 ; DEFAULT: 1 instsimplify - Number of redundant instructions removed