[llvm] [BOLT] Create .text.warm for 3-way splitting (PR #73863)
Maksim Panchenko via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 29 16:13:12 PST 2023
================
@@ -4423,9 +4436,15 @@ void RewriteInstance::updateELFSymbolTable(
Function.getLayout().getSplitFragments()) {
if (FF.getAddress()) {
ELFSymTy NewColdSym = FunctionSymbol;
- const SmallString<256> SymbolName = formatv(
- "{0}.cold.{1}", cantFail(FunctionSymbol.getName(StringSection)),
- FF.getFragmentNum().get() - 1);
+ SmallString<256> SymbolName;
+ if (BC->HasWarmSection)
+ SymbolName = formatv(
+ "{0}.{1}", cantFail(FunctionSymbol.getName(StringSection)),
+ FF.getFragmentNum() == FragmentNum::warm() ? "warm" : "cold");
+ else
+ SymbolName = formatv(
+ "{0}.cold.{1}", cantFail(FunctionSymbol.getName(StringSection)),
+ FF.getFragmentNum().get() - 1);
----------------
maksfb wrote:
Let's factor this code out into a separate helper function.
https://github.com/llvm/llvm-project/pull/73863
More information about the llvm-commits
mailing list