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: Refine post-dominance check in strength reduction #104687

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

jakobbotsch
Copy link
Member

When strength reduction has to find an insertion point for the new primary IV update it needs to find a block that post-dominates all the users of the IV. This was using optReachable before, but that is conservative since it finds paths that may exit the loop. This implements a more precise check.

When strength reduction has to find an insertion point for the new
primary IV update it needs to find a block that post-dominates all the
users of the IV. This was using `optReachable` before, but that is
conservative since it finds paths that may exit the loop. This
implements a more precise check.
@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 Jul 10, 2024
Copy link
Contributor

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

@jakobbotsch
Copy link
Member Author

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@jakobbotsch
Copy link
Member Author

/azp run runtime-coreclr libraries-jitstress, runtime, dotnet-linker-tests

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @AndyAyersMS

Diffs with strength reduction enabled show a lot of new cases where strength reduction is now considered legal.

@jakobbotsch jakobbotsch marked this pull request as ready for review July 11, 2024 17:35
@jakobbotsch jakobbotsch requested a review from AndyAyersMS July 11, 2024 17:35
Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

Looks good.

I wonder if would be more efficient to walk backwards from the loop head backedges, seeing if you can reach block w/o first reaching postDominator?

@jakobbotsch jakobbotsch merged commit b8ac8b2 into dotnet:main Jul 12, 2024
115 of 132 checks passed
@jakobbotsch jakobbotsch deleted the post-dominance-loop branch July 12, 2024 13:00
@jakobbotsch
Copy link
Member Author

I wonder if would be more efficient to walk backwards from the loop head backedges, seeing if you can reach block w/o first reaching postDominator?

Hmm, that could very well be. We could also check all of the users simultaneously instead of just checking them one at a time. I'll keep this in mind for when I start looking at TP.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 12, 2024
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