Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions src/coreclr/jit/fgbasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4938,23 +4938,13 @@ BasicBlock* Compiler::fgSplitEdge(BasicBlock* curr, BasicBlock* succ)

// Set weight for newBlock
//
if (curr->KindIs(BBJ_ALWAYS))
{
newBlock->inheritWeight(curr);
}
else
FlowEdge* const currNewEdge = fgGetPredForBlock(newBlock, curr);
newBlock->bbWeight = currNewEdge->getLikelyWeight();
newBlock->CopyFlags(curr, BBF_PROF_WEIGHT);

if (newBlock->bbWeight == BB_ZERO_WEIGHT)
{
if (curr->hasProfileWeight())
{
FlowEdge* const currNewEdge = fgGetPredForBlock(newBlock, curr);
newBlock->setBBProfileWeight(currNewEdge->getLikelyWeight());
}
else
{
// Todo: use likelihood even w/o profile?
//
newBlock->inheritWeightPercentage(curr, 50);
}
newBlock->bbSetRunRarely();
}

// The bbLiveIn and bbLiveOut are both equal to the bbLiveIn of 'succ'
Expand Down