[llvm] [BOLT][NFC] Add sink block to flow CFG in profile inference (PR #95047)

Amir Ayupov via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 15:45:59 PDT 2024


================
@@ -309,22 +309,33 @@ createFlowFunction(const BinaryFunction::BasicBlockOrderType &BlockOrder) {
   FlowFunction Func;
 
   // Add a special "dummy" source so that there is always a unique entry point.
-  // Because of the extra source, for all other blocks in FlowFunction it holds
-  // that Block.Index == BB->getIndex() + 1
   FlowBlock EntryBlock;
   EntryBlock.Index = 0;
   Func.Blocks.push_back(EntryBlock);
 
+  auto BinaryBlockIsExit = [&](const BinaryBasicBlock &BB) {
----------------
aaupov wrote:

Since we're only using it in a single place, can avoid defining this helper lambda and use the underlying check directly.

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


More information about the llvm-commits mailing list