Skip to content
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

JIT: Remove fgFirstColdBlock checks in frontend phases #110452

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

amanasifkhalid
Copy link
Member

Part of #107749. Now that hot/cold splitting runs after layout in the backend, where the flowgraph is expected to never change, we shouldn't need to check for the presence of a cold code section in the frontend.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 5, 2024
@amanasifkhalid
Copy link
Member Author

/azp run runtime-jit-experimental

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@@ -1401,12 +1401,6 @@ bool Compiler::fgOptimizeEmptyBlock(BasicBlock* block)
break;
}

// can't allow fall through into cold code
if (block->IsLastHotBlock(this))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check looks like it wouldn't pessimize anything if we aren't hot/cold splitting, but IsLastHotBlock returns true if block == fgLastBB too, so this check was blocking empty block removal for the last block in the worklist. Thus, the check's removal incurs some small diffs. PerfScore diffs look wonky due to churn in optSetBlockWeights, but the actual layout diffs look like an improvement.

@amanasifkhalid
Copy link
Member Author

cc @dotnet/jit-contrib, @AndyAyersMS PTAL. runtime-jit-experimental failures are unrelated. Small diffs for reasons explained above. TP improvements seem to stem not just from the removed checks, but from the simplifications I made to BasicBlock::CanRemoveJumpToTarget. There's some outlier TP regression on Linux ARM that I thought was due to native compilers making different inlining decisions, but the regression is only in coreclr_tests MinOpts -- not sure what's going on there.

@amanasifkhalid amanasifkhalid merged commit 637e822 into dotnet:main Dec 6, 2024
115 of 122 checks passed
@amanasifkhalid amanasifkhalid deleted the fgFirstColdBlock-checks branch December 6, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants