[Inliner,OptDiag] Add hotness attribute to opt diagnostics
authorAdam Nemet <anemet@apple.com>
Wed, 10 Aug 2016 00:44:44 +0000 (00:44 +0000)
committerAdam Nemet <anemet@apple.com>
Wed, 10 Aug 2016 00:44:44 +0000 (00:44 +0000)
commit896c09bd10d816edac4d0c5308ec95536c448191
tree440bd2e9b624e15b1cafcaba01d1993a40f5d20a
parent0af91f57cafb6061738adee13d0481c220df7310
[Inliner,OptDiag] Add hotness attribute to opt diagnostics

Summary:
The inliner not being a function pass requires the work-around of
generating the OptimizationRemarkEmitter and in turn BFI on demand.
This will go away after the new PM is ready.

BFI is only computed inside ORE if the user has requested hotness
information for optimization diagnostitics (-pass-remark-with-hotness at
the 'opt' level).  Thus there is no additional overhead without the
flag.

Reviewers: hfinkel, davidxl, eraman

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D22694

llvm-svn: 278185
llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h
llvm/include/llvm/Transforms/IPO/InlinerPass.h
llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp
llvm/lib/Transforms/IPO/Inliner.cpp
llvm/test/Transforms/Inline/optimization-remarks-with-hotness.ll [new file with mode: 0644]