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: Run new block layout only in backend #107634

Merged
merged 7 commits into from
Oct 21, 2024

Conversation

amanasifkhalid
Copy link
Member

@amanasifkhalid amanasifkhalid commented Sep 10, 2024

Follow-up to #107483. This had a lot of churn in both directions locally, though layout doesn't seem to have changed.

@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 Sep 10, 2024
Copy link
Contributor

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

@amanasifkhalid
Copy link
Member Author

amanasifkhalid commented Sep 10, 2024

cc @dotnet/jit-contrib, @AndyAyersMS PTAL. Churn is quite big, and varies between platforms.

This churn seems to be driven by LSRA visiting blocks in a different order. Would it make sense to instead visit blocks in RPO to make it layout-agnostic? cc @kunalspathak

@amanasifkhalid
Copy link
Member Author

Now that LSRA is using its own block order, the diffs seem to be contained to methods with switch statements. I see two broad sources of diffs:

  • Switch lowering has some pretty gnarly lexical dependencies. JIT: Remove fallthrough checks in Compiler::TryLowerSwitchToBitTest #108106 removes a trivial one, though removing the fallthrough checks in Lowering::LowerSwitch doesn't seem simple.
  • Since switch lowering can change flow by converting switch blocks to conditional branches, we're also churning layout (though this churn in particular is probably an improvement, since we can now optimize these changes in flow).

I think modernizing switch lowering is a worthy goal, though since we already don't place as much emphasis on layout quality for switch blocks, I think we should take this churn for now to expedite enabling 3-opt. @AndyAyersMS are you ok with this?

@AndyAyersMS
Copy link
Member

I think modernizing switch lowering is a worthy goal, though since we already don't place as much emphasis on layout quality for switch blocks, I think we should take this churn for now to expedite enabling 3-opt. @AndyAyersMS are you ok with this?

Yes

@amanasifkhalid
Copy link
Member Author

SPMI failure is a timeout, and libraries test failure is known.

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