diff options
author | Bill Wendling <isanbard@gmail.com> | 2019-12-01 23:22:50 -0800 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2019-12-02 15:24:59 -0800 |
commit | 87f146767ed709f6e354fe46f325c5b6848ad428 (patch) | |
tree | 10a8ab8d34af1d3ba18afb79b074198247a2d993 /llvm/lib/Transforms/IPO/HotColdSplitting.cpp | |
parent | 536cedaecbe586ec9cf86d5102872adc27e6ea23 (diff) | |
download | bcm5719-llvm-87f146767ed709f6e354fe46f325c5b6848ad428.tar.gz bcm5719-llvm-87f146767ed709f6e354fe46f325c5b6848ad428.zip |
Place the "cold" code piece into the same section as the original function
Summary:
This cropped up in the Linux kernel where cold code was placed in an
incompatible section.
Reviewers: compnerd, vsk, tejohnson
Reviewed By: vsk
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70925
Diffstat (limited to 'llvm/lib/Transforms/IPO/HotColdSplitting.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/HotColdSplitting.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp index 9db079c7734..2bd3df3add7 100644 --- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp +++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp @@ -328,6 +328,9 @@ Function *HotColdSplitting::extractColdRegion( } CI->setIsNoInline(); + if (OrigF->hasSection()) + OutF->setSection(OrigF->getSection()); + markFunctionCold(*OutF, BFI != nullptr); LLVM_DEBUG(llvm::dbgs() << "Outlined Region: " << *OutF); |