[llvm] [AArch64][BOLT] Ensure tentative code layout for cold BBs runs. (PR #96609)

Vladislav Khmelevsky via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 12:21:44 PDT 2024


================
@@ -382,6 +385,11 @@ uint64_t LongJmpPass::tentativeLayoutRelocMode(
     DotAddress += Func->estimateConstantIslandSize();
     ++CurrentIndex;
   }
+  if (!ColdLayoutDone) {
----------------
yota9 wrote:

After checking out the review again I agree with @rafaelauler. I would rather create lamda with 
`
      DotAddress =
          tentativeLayoutRelocColdPart(BC, SortedFunctions, DotAddress);
      ColdLayoutDone = true;
      if (opts::HotFunctionsAtEnd)
        DotAddress = alignTo(DotAddress, opts::AlignText);
`

And run it under previous condition and under only `if (!ColdLayoutDone)`  after the loop. 

https://github.com/llvm/llvm-project/pull/96609


More information about the llvm-commits mailing list