Skip to content

Conversation

@amanasifkhalid
Copy link
Contributor

@amanasifkhalid amanasifkhalid commented Jan 14, 2025

3-opt performs various checks within hot loops to maintain EH invariants. Since we know beforehand if the method has EH regions or not, we can save a bit of throughput in the latter case by skipping these checks.

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 14, 2025
@dotnet-policy-service
Copy link
Contributor

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

@amanasifkhalid amanasifkhalid marked this pull request as ready for review January 15, 2025 03:02
@amanasifkhalid
Copy link
Contributor Author

cc @dotnet/jit-contrib, @AndyAyersMS PTAL. No diffs. TP improvement is quite small (and almost nonexistent when compiling with MSVC), though this might help keep the cost of rerunning 3-opt down if we decide to implement some strategy for improving upon the single pass. Thanks!

@amanasifkhalid
Copy link
Contributor Author

I'm reviving this since #112004 added some more hot EH checks in. That change also takes care to keep call-finally pairs together when reordering the block list, so we can relax the check in ThreeOptLayout::ConsiderEdge for aligning edges out of call-finally pairs.

@amanasifkhalid
Copy link
Contributor Author

Small diffs from being able to consider edges out of BBJ_CALLFINALLYRET blocks; this looks like a PerfScore improvement. @AndyAyersMS could you PTAL? Thanks!

@amanasifkhalid amanasifkhalid merged commit 3cf22b7 into dotnet:main Mar 3, 2025
109 of 112 checks passed
@amanasifkhalid amanasifkhalid deleted the 3-opt-template-EH-checks branch March 3, 2025 23:36
@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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