Use profile info to set function section prefix to group hot/cold functions.
authorDehao Chen <dehao@google.com>
Tue, 18 Oct 2016 20:42:47 +0000 (20:42 +0000)
committerDehao Chen <dehao@google.com>
Tue, 18 Oct 2016 20:42:47 +0000 (20:42 +0000)
commit302b69c9406b1c690db2e8faaf0a2211dfd46879
tree580f38a5f827e7b9ee3b540edfc028671421347c
parent4dd6c68d67c25af4617238c1308f6aa6caa6e82c
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

llvm-svn: 284533
llvm/include/llvm/IR/Function.h
llvm/include/llvm/IR/LLVMContext.h
llvm/include/llvm/IR/MDBuilder.h
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/lib/IR/Function.cpp
llvm/lib/IR/LLVMContext.cpp
llvm/lib/IR/MDBuilder.cpp
llvm/test/Transforms/CodeGenPrepare/section.ll [new file with mode: 0644]