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: Avoid remorphing general gtFoldExpr return #110658

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakobbotsch
Copy link
Member

Potential alternative to #110516

@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 12, 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

Looks like there are some x86 pre-order calls to gtFoldExpr that are problematic with this attempt.

@AndyAyersMS
Copy link
Member

I am tempted to try something like the following. We remove all setting / checking for the morphed flag outside of morph.

Then we introduce an ambient state "allow remorph" which morph sets around remorphing the results of postorder calls to utilities like gtFoldExpr that make changes (we may also need more reliable means to tell if these utilities indeed made any changes). When this state is set morph doesn't assert if nodes it processes are already morphed. We can decide if we want to operationalize this and actually allow morph to skip remorphing of already morphed trees or just live with some redundant morphing.

Post global morph, we then verify everything got morphed at least once (eg has the flag set).

Or we change the flag into a count and assert post global morph that the count values are always at least 1 and not too large (so we're not doing crazy amounts of possibly redundant morphing).

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