-
Couldn't load subscription status.
- Fork 5.2k
JIT: Repair profile after tail-merging #110656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2437,7 +2437,19 @@ PhaseStatus Compiler::fgTailMergeThrows() | |
| case BBJ_SWITCH: | ||
| { | ||
| JITDUMP("*** " FMT_BB " now branching to " FMT_BB "\n", predBlock->bbNum, canonicalBlock->bbNum); | ||
| FlowEdge* prevEdge = fgGetPredForBlock(nonCanonicalBlock, predBlock); | ||
| weight_t removedWeight = predBlock->bbWeight * prevEdge->getLikelihood(); | ||
| fgReplaceJumpTarget(predBlock, nonCanonicalBlock, canonicalBlock); | ||
|
|
||
| // In practice, when we have true profile data, we can repair it locally here, since the no-return | ||
| // call means that there is no contribution from nonCanonicalBlock to any of its successors. | ||
| // Note that this might not be the case if we have profile data from e.g. synthesis, so this | ||
| // repair is best-effort only. | ||
| canonicalBlock->bbWeight += removedWeight; | ||
|
||
| if (canonicalBlock->bbWeight > BB_ZERO_WEIGHT) | ||
| { | ||
| canonicalBlock->RemoveFlags(BBF_RUN_RARELY); | ||
| } | ||
| updated = true; | ||
| } | ||
| break; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.