SamplePGO - Add optimization reports.
authorDiego Novillo <dnovillo@google.com>
Mon, 26 Oct 2015 18:52:53 +0000 (18:52 +0000)
committerDiego Novillo <dnovillo@google.com>
Mon, 26 Oct 2015 18:52:53 +0000 (18:52 +0000)
commit644d8eaae43035481913aa898626305c59343f85
tree51ebff9672b5733e98aea00a1273809822740615
parent1398e08598b47db3e5521779f5996841bc2f84e9
SamplePGO - Add optimization reports.

This adds a couple of optimization remarks to the SamplePGO
transformation. When it decides to inline a hot function (to mimic the
inline stack and repeat useful inline decisions in the original build).

It will also report branch destinations. For instance, given the code
fragment:

     6      if (i < 1000)
     7        sum -= i;
     8      else
     9        sum += -i * rand();

If the 'else' branch is taken most of the time, building this code with
-Rpass=sample-profile will produce:

a.cc:9:14: remark: most popular destination for conditional branches at small.cc:6:9 [-Rpass=sample-profile]
      sum += -i * rand();
             ^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251330 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/SampleProfile.cpp
test/Transforms/SampleProfile/Inputs/remarks.prof [new file with mode: 0644]
test/Transforms/SampleProfile/remarks.ll [new file with mode: 0644]