Skip to content

Commit 88bb3a7

Browse files
JIT: Remove remaining BBJ_COND fallthrough fixups (#99271)
1 parent e203a15 commit 88bb3a7

2 files changed

Lines changed: 2 additions & 32 deletions

File tree

src/coreclr/jit/fgehopt.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,28 +2103,14 @@ void Compiler::fgTailMergeThrowsFallThroughHelper(BasicBlock* predBlock,
21032103
assert(predBlock->KindIs(BBJ_COND));
21042104
assert(predBlock->FalseTargetIs(nonCanonicalBlock));
21052105

2106-
BasicBlock* const newBlock = fgNewBBafter(BBJ_ALWAYS, predBlock, true);
2107-
2108-
JITDUMP("*** " FMT_BB " now falling through to empty " FMT_BB " and then to " FMT_BB "\n", predBlock->bbNum,
2109-
newBlock->bbNum, canonicalBlock->bbNum);
2106+
JITDUMP("*** " FMT_BB " false target is now " FMT_BB "\n", predBlock->bbNum, canonicalBlock->bbNum);
21102107

21112108
// Remove the old flow
21122109
fgRemoveRefPred(predEdge);
21132110

21142111
// Wire up the new flow
2115-
FlowEdge* const falseEdge = fgAddRefPred(newBlock, predBlock, predEdge);
2112+
FlowEdge* const falseEdge = fgAddRefPred(canonicalBlock, predBlock, predEdge);
21162113
predBlock->SetFalseEdge(falseEdge);
2117-
2118-
FlowEdge* const newEdge = fgAddRefPred(canonicalBlock, newBlock, predEdge);
2119-
newBlock->SetTargetEdge(newEdge);
2120-
2121-
// If nonCanonicalBlock has only one pred, all its flow transfers.
2122-
// If it has multiple preds, then we need edge counts or likelihoods
2123-
// to figure things out.
2124-
//
2125-
// For now just do a minimal update.
2126-
//
2127-
newBlock->inheritWeight(nonCanonicalBlock);
21282114
}
21292115

21302116
//------------------------------------------------------------------------

src/coreclr/jit/fgopt.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4994,22 +4994,6 @@ bool Compiler::fgUpdateFlowGraph(bool doTailDuplication /* = false */, bool isPh
49944994
{
49954995
ehUpdateLastBlocks(bNext, bDest);
49964996
}
4997-
4998-
// Add fall through fixup block, if needed.
4999-
//
5000-
if (bDest->KindIs(BBJ_COND) && !bDest->NextIs(bDest->GetFalseTarget()))
5001-
{
5002-
BasicBlock* const bDestFalseTarget = bDest->GetFalseTarget();
5003-
BasicBlock* const bFixup = fgNewBBafter(BBJ_ALWAYS, bDest, true);
5004-
bFixup->inheritWeight(bDestFalseTarget);
5005-
5006-
fgRemoveRefPred(bDest->GetFalseEdge());
5007-
FlowEdge* const falseEdge = fgAddRefPred(bFixup, bDest);
5008-
bDest->SetFalseEdge(falseEdge);
5009-
5010-
FlowEdge* const newEdge = fgAddRefPred(bDestFalseTarget, bFixup);
5011-
bFixup->SetTargetEdge(newEdge);
5012-
}
50134997
}
50144998
}
50154999

0 commit comments

Comments
 (0)