1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/lib/IR
Michael J. Spencer 9f6a23f8c6 [Instrumentation] Add Call Graph Profile pass
This patch adds support for generating a call graph profile from Branch Frequency Info.

The CGProfile module pass simply gets the block profile count for each BB and scans for call instructions. For each call instruction it adds an edge from the current function to the called function with the current BB block profile count as the weight.

After scanning all the functions, it generates an appending module flag containing the data. The format looks like:

!llvm.module.flags = !{!0}

!0 = !{i32 5, !"CG Profile", !1}
!1 = !{!2, !3, !4} ; List of edges
!2 = !{void ()* @a, void ()* @b, i64 32} ; Edge from a to b with a weight of 32
!3 = !{void (i1)* @freq, void ()* @a, i64 11}
!4 = !{void (i1)* @freq, void ()* @b, i64 20}

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

llvm-svn: 335306
2018-06-21 23:31:10 +00:00
..
AsmWriter.cpp [ADT] Make escaping fn conform to coding guidelines 2018-05-31 17:01:42 +00:00
AttributeImpl.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Attributes.cpp [ADT] Make escaping fn conform to coding guidelines 2018-05-31 17:01:42 +00:00
AttributesCompatFunc.td
AutoUpgrade.cpp [X86] Remove masking from 512-bit floating max/min intrinsics. Use select instruction instead. 2018-06-21 05:00:56 +00:00
BasicBlock.cpp [IR] Introduce helpers to skip debug instructions (NFC) 2018-06-19 23:42:17 +00:00
CMakeLists.txt [IR][CodeGen] Remove dependency on EVT from IR/Function.cpp. Move EVT to CodeGen layer. 2018-03-29 17:21:10 +00:00
Comdat.cpp [LLVM-C] [bindings/go] Add C and Golang bindings for COMDAT 2018-03-14 18:33:53 +00:00
ConstantFold.cpp [IR] add/use isIntDivRem convenience function 2018-06-20 19:02:17 +00:00
ConstantFold.h
ConstantRange.cpp IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
Constants.cpp Make ConstantDataArray::get constructor templated. Will support signed integers. 2018-03-19 19:49:28 +00:00
ConstantsContext.h Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
Core.cpp [LLVM-C] Improve Bindings For Aliases 2018-05-20 23:49:08 +00:00
DataLayout.cpp Use uniform mechanism for OOM errors handling 2018-06-09 05:19:45 +00:00
DebugInfo.cpp Extend the GlobalObject metadata interface 2018-05-31 13:29:58 +00:00
DebugInfoMetadata.cpp [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
DebugLoc.cpp IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
DiagnosticHandler.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
DiagnosticInfo.cpp This change add's optimization remark in LoopVersioning LICM pass. 2018-01-23 09:47:28 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp [DebugInfo] Refactoring DIType::setFlags to DIType::cloneWithFlags, NFC 2018-06-01 23:15:09 +00:00
Dominators.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Function.cpp Add remarks describing when a pass changes the IR instruction count of a module 2018-05-18 17:26:39 +00:00
Globals.cpp Sink Analysis/ObjectUtil(canBeOmittedFromSymbolTable) into IR so it can be legitimately be used by Object/IRSymtab 2018-03-21 19:23:45 +00:00
GVMaterializer.cpp
InlineAsm.cpp [inlineasm] Fix crash when number of matched input constraint operands overflows signed char 2017-10-25 12:51:32 +00:00
Instruction.cpp [IR] Introduce helpers to skip debug instructions (NFC) 2018-06-19 23:42:17 +00:00
Instructions.cpp [IR] move shuffle mask queries from TTI to ShuffleVectorInst 2018-06-19 18:44:00 +00:00
IntrinsicInst.cpp Re-apply "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue" 2018-06-15 13:48:55 +00:00
IRBuilder.cpp [IRBuilder] Add APIs for creating calls to atomic memmove and memset intrinsics. (NFC) 2018-05-30 20:02:56 +00:00
IRPrintingPasses.cpp [Debugify] Add -debugify-each for testing each pass in a pipeline 2018-05-15 00:29:27 +00:00
LegacyPassManager.cpp Reland: [Timers] Use the pass argument name for JSON keys in time-passes 2018-06-13 21:03:56 +00:00
LLVMBuild.txt
LLVMContext.cpp allow custom OptBisect classes set to LLVMContext 2018-04-05 10:29:37 +00:00
LLVMContextImpl.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
LLVMContextImpl.h Extend the GlobalObject metadata interface 2018-05-31 13:29:58 +00:00
Mangler.cpp [IR] Avoid the need to prefix MS C++ symbols with '\01' 2018-03-16 20:13:32 +00:00
MDBuilder.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Metadata.cpp Extend the GlobalObject metadata interface 2018-05-31 13:29:58 +00:00
MetadataImpl.h
Module.cpp Add remarks describing when a pass changes the IR instruction count of a module 2018-05-18 17:26:39 +00:00
ModuleSummaryIndex.cpp [ThinLTO] Add GraphTraits for FunctionSummaries 2018-02-19 15:14:50 +00:00
Operator.cpp Adding a width of the GEP index to the Data Layout. 2018-02-14 06:58:08 +00:00
OptBisect.cpp [NFC] OptPassGate extracted from OptBisect 2018-03-27 16:57:20 +00:00
Pass.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
PassManager.cpp
PassRegistry.cpp
ProfileSummary.cpp [ProfileSummary] Move a vector we're about to destroy anyway; NFC 2018-04-12 20:54:05 +00:00
SafepointIRVerifier.cpp SafepointIRVerifier is made unreachable block tolerant 2018-05-23 05:54:55 +00:00
Statepoint.cpp
SymbolTableListTraitsImpl.h
Type.cpp
TypeFinder.cpp Use ranged for loops in TypeFinder.cpp, NFC 2018-02-08 18:02:27 +00:00
Use.cpp
User.cpp Remove redundant includes from lib/IR. 2017-12-13 21:30:52 +00:00
Value.cpp In thin and full LTO + CFI, direct function calls may go through jump table 2018-06-04 18:18:12 +00:00
ValueSymbolTable.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
Verifier.cpp [Instrumentation] Add Call Graph Profile pass 2018-06-21 23:31:10 +00:00