diff options
author | Hal Finkel <hfinkel@anl.gov> | 2016-10-05 22:25:33 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2016-10-05 22:25:33 +0000 |
commit | 5aa02480594f861efc332650188eef6b2986a269 (patch) | |
tree | cf02efcef81760eb154c5699708047245c466314 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | b3510afcd1eb1c03bb4b30b3a53cc5c6a9997227 (diff) | |
download | bcm5719-llvm-5aa02480594f861efc332650188eef6b2986a269.tar.gz bcm5719-llvm-5aa02480594f861efc332650188eef6b2986a269.zip |
[llvm-opt-report] Distinguish inlined contexts when optimizations differ
How code is optimized sometimes, perhaps often, depends on the context into
which it was inlined. This change allows llvm-opt-report to track the
differences between the optimizations performed, or not, in different contexts,
and when these differ, display those differences.
For example, this code:
$ cat /tmp/q.cpp
void bar();
void foo(int n) {
for (int i = 0; i < n; ++i)
bar();
}
void quack() {
foo(4);
}
void quack2() {
foo(4);
}
will now produce this report:
< /home/hfinkel/src/llvm/test/tools/llvm-opt-report/Inputs/q.cpp
2 | void bar();
3 | void foo(int n) {
[[
> foo(int):
4 | for (int i = 0; i < n; ++i)
> quack(), quack2():
4 U4 | for (int i = 0; i < n; ++i)
]]
5 | bar();
6 | }
7 |
8 | void quack() {
9 I | foo(4);
10 | }
11 |
12 | void quack2() {
13 I | foo(4);
14 | }
15 |
Note that the tool has demangled the function names, and grouped the reports
associated with line 4. This shows that the loop on line 4 was unrolled by a
factor of 4 when inlined into the functions quack() and quack2(), but not in
the function foo(int) itself.
llvm-svn: 283402
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
0 files changed, 0 insertions, 0 deletions