Skip to content

Ensure that we properly set the morphed flag#127167

Merged
tannergooding merged 1 commit intodotnet:mainfrom
tannergooding:fix-127138
Apr 20, 2026
Merged

Ensure that we properly set the morphed flag#127167
tannergooding merged 1 commit intodotnet:mainfrom
tannergooding:fix-127138

Conversation

@tannergooding
Copy link
Copy Markdown
Member

This resolves #127138

In some cases we need to ensure the introduced node is explicitly marked as morphed since it may not be returning through fgMorphHWIntrinsic. This was a pre-existing issue, but one that only surfaced due to the fixed IsVectorPerElementMask check.

Copilot AI review requested due to automatic review settings April 20, 2026 16:06
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 20, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

@tannergooding
Copy link
Copy Markdown
Member Author

CC. @dotnet/jit-contrib for review. Resolves #127138

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a CoreCLR JIT global morph (DEBUG) assertion by ensuring HWIntrinsic nodes introduced/updated during morph are explicitly marked as “morphed” when they won’t necessarily flow back through fgMorphHWIntrinsic as the returned node.

Changes:

  • Mark the inner operand as morphed after required/optional morphing when folding creates a vector↔mask conversion that needs its inner node re-morphed.
  • In fgMorphHWIntrinsicRequired, explicitly mark newly introduced/re-morphed nodes as morphed in transformation paths that attach them as operands (rather than returning them directly).

Copy link
Copy Markdown
Member

@kg kg left a comment

Choose a reason for hiding this comment

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

Looks safe, makes me wonder if there are any TP regressions but I assume they would be small

@tannergooding
Copy link
Copy Markdown
Member Author

makes me wonder if there are any TP regressions

Nothing measurable: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1387320&view=ms.vss-build-web.run-extensions-tab

Hardware intrinsics tend to be a minority of code so it typically doesn't show up on the overall measurements.

@tannergooding tannergooding merged commit 1062a3b into dotnet:main Apr 20, 2026
140 of 145 checks passed
@tannergooding tannergooding deleted the fix-127138 branch April 20, 2026 22:31
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.

Test Failure: coreclr jitstress assert "WasMorphed()"

3 participants