summaryrefslogtreecommitdiff
path: root/lib/IR/LLVMContext.cpp
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-10-18 20:42:47 +0000
committerDehao Chen <dehao@google.com>2016-10-18 20:42:47 +0000
commit977fc82cacbbf38008a5b2f86b2b10f37b820965 (patch)
tree2f756732e8e00232bd5385fbeb3b46b2d19e51da /lib/IR/LLVMContext.cpp
parentbe23217b8d792cd265ece59534776e9e4da6d9e6 (diff)
Use profile info to set function section prefix to group hot/cold functions.
Summary: The original implementation is in r261607, which was reverted in r269726 to accomendate the ProfileSummaryInfo analysis pass. The new implementation: 1. add a new metadata for function section prefix 2. query against ProfileSummaryInfo in CGP to set the correct section prefix for each function 3. output the section prefix set by CGP Reviewers: davidxl, eraman Subscribers: vsk, llvm-commits Differential Revision: https://reviews.llvm.org/D24989 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/LLVMContext.cpp')
-rw-r--r--lib/IR/LLVMContext.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/IR/LLVMContext.cpp b/lib/IR/LLVMContext.cpp
index c97228fd51a..9dac6151499 100644
--- a/lib/IR/LLVMContext.cpp
+++ b/lib/IR/LLVMContext.cpp
@@ -138,6 +138,11 @@ LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) {
assert(TypeID == MD_type && "type kind id drifted");
(void)TypeID;
+ unsigned SectionPrefixID = getMDKindID("section_prefix");
+ assert(SectionPrefixID == MD_section_prefix &&
+ "section_prefix kind id drifted");
+ (void)SectionPrefixID;
+
auto *DeoptEntry = pImpl->getOrInsertBundleTag("deopt");
assert(DeoptEntry->second == LLVMContext::OB_deopt &&
"deopt operand bundle id drifted!");