OSDN Git Service

Enrich inline messages
authorDavid Bolvansky <david.bolvansky@gmail.com>
Tue, 31 Jul 2018 14:25:24 +0000 (14:25 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Tue, 31 Jul 2018 14:25:24 +0000 (14:25 +0000)
commit99862d39d7c23ff9efdb3f3a309840a03b924d66
tree6250db676537cbefaf400fb2630fd6cd2af639b3
parent8838d03a84a1ff78cf07270dd4e8f64e1915bad7
Enrich inline messages

Summary:
This patch improves Inliner to provide causes/reasons for negative inline decisions.
1. It adds one new message field to InlineCost to report causes for Always and Never instances. All Never and Always instantiations must provide a simple message.
2. Several functions that used to return the inlining results as boolean are changed to return InlineResult which carries the cause for negative decision.
3. Changed remark priniting and debug output messages to provide the additional messages and related inline cost.
4. Adjusted tests for changed printing.

Patch by: yrouban (Yevgeny Rouban)

Reviewers: craig.topper, sammccall, sgraenitz, NutshellySima, shchenz, chandlerc, apilipenko, javed.absar, tejohnson, dblaikie, sanjoy, eraman, xbolva00

Reviewed By: tejohnson, xbolva00

Subscribers: xbolva00, llvm-commits, arsenm, mehdi_amini, eraman, haicheng, steven_wu, dexonsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338387 91177308-0d34-0410-b5e6-96231b3b80d8
20 files changed:
include/llvm/Analysis/InlineCost.h
include/llvm/IR/DiagnosticInfo.h
include/llvm/Transforms/Utils/Cloning.h
lib/Analysis/InlineCost.cpp
lib/Target/AMDGPU/AMDGPUInline.cpp
lib/Transforms/IPO/AlwaysInliner.cpp
lib/Transforms/IPO/Inliner.cpp
lib/Transforms/Utils/InlineFunction.cpp
test/LTO/Resolution/X86/diagnostic-handler-remarks-with-hotness.ll
test/LTO/Resolution/X86/diagnostic-handler-remarks.ll
test/LTO/X86/diagnostic-handler-remarks-with-hotness.ll
test/LTO/X86/diagnostic-handler-remarks.ll
test/ThinLTO/X86/diagnostic-handler-remarks-with-hotness.ll
test/ThinLTO/X86/diagnostic-handler-remarks.ll
test/Transforms/Inline/ARM/inline-fp.ll
test/Transforms/Inline/optimization-remarks-hotness-threshold.ll
test/Transforms/Inline/optimization-remarks-passed-yaml.ll
test/Transforms/Inline/optimization-remarks-with-hotness.ll
test/Transforms/Inline/optimization-remarks.ll
test/tools/gold/X86/opt-remarks.ll