1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/lib/IR
Adam Nemet cb89dd6834 [OptRemark,LDist] RFC: Add hotness attribute
Summary:
This is the first set of changes implementing the RFC from
http://thread.gmane.org/gmane.comp.compilers.llvm.devel/98334

This is a cross-sectional patch; rather than implementing the hotness
attribute for all optimization remarks and all passes in a patch set, it
implements it for the 'missed-optimization' remark for Loop
Distribution.  My goal is to shake out the design issues before scaling
it up to other types and passes.

Hotness is computed as an integer as the multiplication of the block
frequency with the function entry count.  It's only printed in opt
currently since clang prints the diagnostic fields directly.  E.g.:

  remark: /tmp/t.c:3:3: loop not distributed: use -Rpass-analysis=loop-distribute for more info (hotness: 300)

A new API added is similar to emitOptimizationRemarkMissed.  The
difference is that it additionally takes a code region that the
diagnostic corresponds to.  From this, hotness is computed using BFI.
The new API is exposed via an analysis pass so that it can be made
dependent on LazyBFI.  (Thanks to Hal for the analysis pass idea.)

This feature can all be enabled by setDiagnosticHotnessRequested in the
LLVM context.  If this is off, LazyBFI is not calculated (D22141) so
there should be no overhead.

A new command-line option is added to turn this on in opt.

My plan is to switch all user of emitOptimizationRemark* to use this
module instead.

Reviewers: hfinkel

Subscribers: rcox2, mzolotukhin, llvm-commits

Differential Revision: http://reviews.llvm.org/D21771

llvm-svn: 275583
2016-07-15 17:23:20 +00:00
..
AsmWriter.cpp [codeview] Add DISubprogram::ThisAdjustment 2016-07-01 02:41:21 +00:00
AttributeImpl.h Apply clang-tidy's modernize-loop-convert to most of lib/IR. 2016-06-26 14:10:56 +00:00
Attributes.cpp Add getReturnedArgOperand to Call/InvokeInst, CallSite 2016-07-10 23:01:32 +00:00
AttributesCompatFunc.td
AutoUpgrade.cpp [AVX512] Remove masked logic op intrinsics and autoupgrade them to native IR. 2016-07-12 05:27:53 +00:00
BasicBlock.cpp Apply clang-tidy's modernize-loop-convert to most of lib/IR. 2016-06-26 14:10:56 +00:00
CMakeLists.txt Move ProfileSummary to IR. 2016-05-19 21:07:12 +00:00
Comdat.cpp [NFC] Remove some dead code: 2016-05-11 16:38:40 +00:00
ConstantFold.cpp [ConstantFold] Don't incorrectly infer inbounds on array GEP 2016-07-13 03:24:41 +00:00
ConstantFold.h
ConstantRange.cpp fix formatting, typo; NFC 2016-06-19 17:20:27 +00:00
Constants.cpp Apply clang-tidy's modernize-loop-convert to most of lib/IR. 2016-06-26 14:10:56 +00:00
ConstantsContext.h
Core.cpp Apply clang-tidy's modernize-loop-convert to most of lib/IR. 2016-06-26 14:10:56 +00:00
DataLayout.cpp [IR] Make getIndexedOffsetInType return a signed result 2016-07-13 03:42:38 +00:00
DebugInfo.cpp StripDebugInfo: uses isa<DbgInfoIntrinsic> instead of matching against llvm.dbg.* (NFC) 2016-05-14 04:58:35 +00:00
DebugInfoMetadata.cpp [codeview] Add DISubprogram::ThisAdjustment 2016-07-01 02:41:21 +00:00
DebugLoc.cpp
DiagnosticInfo.cpp [OptRemark,LDist] RFC: Add hotness attribute 2016-07-15 17:23:20 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp [DIBuilder] Remove dead code. NFC. 2016-07-02 13:18:38 +00:00
Dominators.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
Function.cpp IR: Sort generic intrinsics before target specific ones 2016-07-15 16:31:37 +00:00
GCOV.cpp
Globals.cpp [IR] [DAE] Copy comdats during DAE, and don't copy comdats in GlobalObject::copyAttributesFrom. 2016-06-15 23:20:15 +00:00
GVMaterializer.cpp
InlineAsm.cpp [InlineAsm] Avoid creating extra string instances in ConstraintInfo::Parse() 2016-05-23 13:58:04 +00:00
Instruction.cpp [IR] andIRFlags and copyIRFlags needs to handle GEP 2016-07-15 05:02:31 +00:00
Instructions.cpp Add getReturnedArgOperand to Call/InvokeInst, CallSite 2016-07-10 23:01:32 +00:00
IntrinsicInst.cpp [NFC] Remove some dead code: 2016-05-11 16:38:40 +00:00
IRBuilder.cpp Support arbitrary addrspace pointers in masked load/store intrinsics 2016-06-28 18:27:25 +00:00
IRPrintingPasses.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
LegacyPassManager.cpp Remove doInitialization() and doFinalization() member declarations without definitions. 2016-04-28 19:21:30 +00:00
LLVMBuild.txt
LLVMContext.cpp [OptRemark,LDist] RFC: Add hotness attribute 2016-07-15 17:23:20 +00:00
LLVMContextImpl.cpp [OptRemark,LDist] RFC: Add hotness attribute 2016-07-15 17:23:20 +00:00
LLVMContextImpl.h [OptRemark,LDist] RFC: Add hotness attribute 2016-07-15 17:23:20 +00:00
Mangler.cpp
MDBuilder.cpp Fix the assertion failure caused by http://reviews.llvm.org/D22118 2016-07-11 17:36:02 +00:00
Metadata.cpp Fix the assertion failure caused by http://reviews.llvm.org/D22118 2016-07-11 17:36:02 +00:00
MetadataImpl.h
Module.cpp Remove interface to get/set MaxFunctionCount 2016-06-20 21:36:38 +00:00
ModuleSummaryIndex.cpp
Operator.cpp
OptBisect.cpp
Pass.cpp
PassManager.cpp [PM] Run clang-format over various parts of the new pass manager code 2016-06-17 07:15:29 +00:00
PassRegistry.cpp
ProfileSummary.cpp Reapply r271728 after adding move cobstructor for ProfileSummaryInfo 2016-06-03 22:54:26 +00:00
Statepoint.cpp
SymbolTableListTraitsImpl.h
Type.cpp fix documentation comments; NFC 2016-06-02 20:37:52 +00:00
TypeFinder.cpp Apply clang-tidy's modernize-loop-convert to most of lib/IR. 2016-06-26 14:10:56 +00:00
Use.cpp
User.cpp
Value.cpp BasicAA should look through functions with returned arguments 2016-07-11 01:32:20 +00:00
ValueSymbolTable.cpp Apply clang-tidy's modernize-loop-convert to most of lib/IR. 2016-06-26 14:10:56 +00:00
ValueTypes.cpp
Verifier.cpp Add writeonly IR attribute 2016-07-04 08:01:29 +00:00