[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:46:00 PDT 2024
================
@@ -360,25 +371,37 @@ createFlowFunction(const BinaryFunction::BasicBlockOrderType &BlockOrder) {
// Add dummy edges to the extra sources. If there are multiple entry blocks,
// add an unlikely edge from 0 to the subsequent ones
assert(InDegree[0] == 0 && "dummy entry blocks shouldn't have predecessors");
- for (uint64_t I = 1; I < Func.Blocks.size(); I++) {
+ for (uint64_t I = 1; I < BlockOrder.size() + 1; I++) {
const BinaryBasicBlock *BB = BlockOrder[I - 1];
if (BB->isEntryPoint() || InDegree[I] == 0) {
Func.Jumps.emplace_back();
FlowJump &Jump = Func.Jumps.back();
- Jump.Source = 0;
+ Jump.Source = Func.Entry;
----------------
aaupov wrote:
We're not changing the index of the entry, right? So this change is not needed.
https://github.com/llvm/llvm-project/pull/95047
More information about the llvm-commits
mailing list