Minimally allow Vector.Shuffle to expand for values that become constant by global morph #102676
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes:
From generating:
to instead generate:
Due to limitations in forward sub, this does not handle some other cases where other statements interfere with the ability to substitute.
Doing this post global morph is much more difficult as the call gets rewritten to spilled locals, such as:
This is basically the same reason we can't do what
GT_INTRINSIC
does by just carrying aGT_HWINTRINSIC
down to rationalization and rewriting it back to a call. The ABI handling around return buffers and parameter passing happens very early today (return buffers around import and parameter passing in global morph). If the ABI handling were moved down, then we could move this logic later (such as post VN) and catch essentially all cases instead.