diff --git a/src/coreclr/jit/patchpoint.cpp b/src/coreclr/jit/patchpoint.cpp index d63af93092b454..27b94470962ef0 100644 --- a/src/coreclr/jit/patchpoint.cpp +++ b/src/coreclr/jit/patchpoint.cpp @@ -151,8 +151,13 @@ class PatchpointTransformer helperBlock->SetFlags(BBF_BACKWARD_JUMP | BBF_NONE_QUIRK); - compiler->fgAddRefPred(helperBlock, block); - compiler->fgAddRefPred(remainderBlock, helperBlock); + FlowEdge* const falseEdge = compiler->fgAddRefPred(helperBlock, block); + FlowEdge* const trueEdge = compiler->fgGetPredForBlock(remainderBlock, block); + trueEdge->setLikelihood(HIGH_PROBABILITY / 100.0); + falseEdge->setLikelihood((100 - HIGH_PROBABILITY) / 100.0); + + FlowEdge* const newEdge = compiler->fgAddRefPred(remainderBlock, helperBlock); + newEdge->setLikelihood(1.0); // Update weights remainderBlock->inheritWeight(block);