[llvm] [BasicBlockSections] Allow mixing of -basic-block-sections with MFS. (PR #117076)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 12:22:16 PST 2024


================
@@ -128,6 +129,9 @@ static bool isColdBlock(const MachineBasicBlock &MBB,
 }
 
 bool MachineFunctionSplitter::runOnMachineFunction(MachineFunction &MF) {
+  // Do not split functions when -basic-block-sections=all is specified.
+  if (MF.getTarget().getBBSectionsType() == llvm::BasicBlockSection::All)
+    return false;
----------------
boomanaiden154 wrote:

For mapping, we just use the basic block address map rather than basic block sections as we only need to know where blocks are and their size rather than any ability to rearrange/GC them in the linker.

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


More information about the llvm-commits mailing list