diff options
| author | Siddharth Bhat <siddu.druid@gmail.com> | 2017-06-02 09:20:02 +0000 |
|---|---|---|
| committer | Siddharth Bhat <siddu.druid@gmail.com> | 2017-06-02 09:20:02 +0000 |
| commit | a4dea6bb0570fc5a3cd9d553a380e012ce210e60 (patch) | |
| tree | cfe2f4998b5653a7856113019c089b37559aedef /polly/lib/CodeGen | |
| parent | 437f7060fe6335b488c3b326930606681c8531fe (diff) | |
| download | bcm5719-llvm-a4dea6bb0570fc5a3cd9d553a380e012ce210e60.tar.gz bcm5719-llvm-a4dea6bb0570fc5a3cd9d553a380e012ce210e60.zip | |
[CodeGen] Print performance counter information in CSV.
This ensures that tools can parse performance information which Polly
generates easily.
- Sample output:
```name=out.csv
scop function, entry block name, exit block name, total time
warmup, %entry.split, %polly.merge_new_and_old, 1960
f, %entry.split, %polly.merge_new_and_old, 1238
g, %entry.split, %polly.merge_new_and_old, 1218
```
- Example code to parse output:
```lang=python, name=example-parse.py
import asciitable
import sys
table = asciitable.read('out.csv', delimiter=',')
asciitable.write(table, sys.stdout, delimiter=',')
```
llvm-svn: 304533
Diffstat (limited to 'polly/lib/CodeGen')
| -rw-r--r-- | polly/lib/CodeGen/PerfMonitor.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/polly/lib/CodeGen/PerfMonitor.cpp b/polly/lib/CodeGen/PerfMonitor.cpp index 9fbd07b2649..5423d5a4fa6 100644 --- a/polly/lib/CodeGen/PerfMonitor.cpp +++ b/polly/lib/CodeGen/PerfMonitor.cpp @@ -152,6 +152,15 @@ Function *PerfMonitor::insertFinalReporting() { RuntimeDebugBuilder::createCPUPrinter(Builder, "Total: ", CyclesTotal, "\n"); RuntimeDebugBuilder::createCPUPrinter(Builder, "Scops: ", CyclesInScops, "\n"); + + // Print the preamble for per-scop information. + RuntimeDebugBuilder::createCPUPrinter(Builder, "\n"); + RuntimeDebugBuilder::createCPUPrinter(Builder, "Per SCoP information\n"); + RuntimeDebugBuilder::createCPUPrinter(Builder, "--------------------\n"); + + RuntimeDebugBuilder::createCPUPrinter( + Builder, "scop function, " + "entry block name, exit block name, total time\n"); ReturnFromFinal = Builder.CreateRetVoid(); return ExitFn; } @@ -173,9 +182,10 @@ void PerfMonitor::AppendScopReporting() { std::string EntryName, ExitName; std::tie(EntryName, ExitName) = S.getEntryExitStr(); - RuntimeDebugBuilder::createCPUPrinter( - Builder, "Scop(", S.getFunction().getName(), " |from: ", EntryName, - " |to: ", ExitName, "): ", CyclesInCurrentScop, "\n"); + // print in CSV for easy parsing with other tools. + RuntimeDebugBuilder::createCPUPrinter(Builder, S.getFunction().getName(), + ", ", EntryName, ", ", ExitName, ", ", + CyclesInCurrentScop, "\n"); ReturnFromFinal = Builder.CreateRetVoid(); } |

