OSDN Git Service

Enrich inline messages
authorDavid Bolvansky <david.bolvansky@gmail.com>
Wed, 1 Aug 2018 07:37:16 +0000 (07:37 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Wed, 1 Aug 2018 07:37:16 +0000 (07:37 +0000)
commit788bdbbd5c99d805a2992689b1c5bad255da131c
tree437bda43780519ce16ac6635559ec6810fa29545
parent4e7dc16e1cfa1156f9f12085d743a118861e8349
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@338494 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