1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/include/llvm/Transforms
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
..
AggressiveInstCombine Fix some layering in AggressiveInstCombine (avoiding inclusion of Scalar.h) 2018-04-24 15:40:07 +00:00
InstCombine Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
Instrumentation Fix Layering, move instrumentation transform headers into Instrumentation subdirectory 2018-03-23 22:11:06 +00:00
IPO Move SampleProfile.h into IPO along with the rest of the IPO pass headers 2018-03-22 22:42:44 +00:00
Scalar Revert r335206 "Recommit r333268: [IPSCCP] Use PredicateInfo to propagate facts from cmp instructions." 2018-06-21 19:18:36 +00:00
Utils Generalize MergeBlockIntoPredecessor. Replace uses of MergeBasicBlockIntoOnlyPred. 2018-06-20 22:01:04 +00:00
Vectorize Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Coroutines.h
Instrumentation.h [Instrumentation] Add Call Graph Profile pass 2018-06-21 23:31:10 +00:00
IPO.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
ObjCARC.h
Scalar.h Revert 333358 as it's failing on some builders. 2018-05-27 12:54:33 +00:00
Utils.h Fix some layering in StripNonLineTableDebugInfo, moving its declaration from IPO.h to Utils.h to match its implementation 2018-03-29 22:42:08 +00:00
Vectorize.h Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00