You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow up on #134410 by tracking AVX upper state from register-producing widths rather than vector types or memory-store widths. This removes unnecessary vzeroupper instructions while accounting for previously missed wide loads, copies, and integer-division intermediates.
Account for allocator-inserted spills/reloads and actual local register copies.
Narrow unsafe-widening/extraction copies to the defined source or required result width, and use XMM zeroing in integer-vector division.
Preserve the existing call/prolog/epilog clearing policy. Native-boundary policy changes, including the pre-existing unmanaged calli gap, remain out of scope.
ARM, ARM64, and WASM have no assembly diffs. Windows corpus coverage expanded substantially, so raw totals are not directly comparable with earlier runs. Remaining growth includes both corrected wide-producer accounting and conservative method-wide cleanup placement; it is not all individually necessary transition cleanup.
JIT executed-instruction counts increased approximately 0.011–0.031% on xarch; these are compiler-work measurements, not application-throughput results. The assembly runs report zero failing compilations, with symmetric missing-context counts between base and diff.
Validated with Checked x64/all-target JIT builds, focused execution and disassembly checks across default/AVX2/AVX/SSE/software configurations, targeted register-stress runs, and JIT formatting. Runtime execution was on Windows x64; cross-target replay is not runtime execution on those platforms.
Note
This PR description and implementation were prepared with GitHub Copilot assistance.
Account for wide temporaries and allocator-generated reloads while avoiding unnecessary clears for narrow producers and stores. Recognize unmanaged calli boundaries and narrow unsafe vector copies and division zeroing.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Retain the merged block-operation fix and its comments while preserving the additional producer-width tracking and codegen changes.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Azure Pipelines:
Successfully started running 6 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.
Constrain Vector<T> to 128 bits so Vector512 narrowing exercises GetLower128, and verify the narrow copy preserves both the result and source.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This pattern does not actually verify the new unmanaged-calli behavior: CallUnmanaged necessarily emits an xorps/vxorps to materialize Vector128<float>.Zero, so the alternation can match that instruction even when NeedsVzeroupper still returns false for IsUnmanaged(). The regression would therefore pass against the old JIT; constrain the check to vzeroupper in AVX-enabled runs (and separately cover the no-AVX fallback), or otherwise make the call-site assertion unambiguous.
Regarding the unmanaged calli test finding in the review summary: the leading space in {{vzeroupper| xorps }} is intentional. The xorps alternative matches the legacy instruction used without AVX, but cannot match vxorps.
The preserved pre-fix AVX-enabled disassembly contains vxorps xmm0, xmm0, xmm0 and no vzeroupper; it fails this exact check. The fixed disassembly includes vzeroupper and passes. The test therefore distinguishes the missing unmanaged-call clearing from the no-AVX fallback as intended.
Note
This reply was drafted with GitHub Copilot assistance.
Preserve existing native-boundary classification and defer unmanaged calli cleanup ownership to a separate change.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@EgorBo for this one it does some more cleanup and fixes other places we were incorrectly handling vzeroupper.
It still doesn't handle every possible case of unmanaged call (such as through calli, certain delegates, or fnptrs) because that caused far too many regressions and needs more complex handling to do properly.
The size regressions that are still present are generally correctness improvements. Ideally we'd have a bit more sophisticated tracked to avoid doing the operation unnecessarily, particularly when there's like only a single YMM usage late or optionally in the method, but that is a much more complex and involved fix.
This at least generally fixes the remaining cases that were trivially incorrectly tracking the state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
4 participants
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.
Follow up on #134410 by tracking AVX upper state from register-producing widths rather than vector types or memory-store widths. This removes unnecessary
vzeroupperinstructions while accounting for previously missed wide loads, copies, and integer-division intermediates.calligap, remain out of scope.SuperPMI results
CI build 1610798, testing head
b20f2c3d058:ARM, ARM64, and WASM have no assembly diffs. Windows corpus coverage expanded substantially, so raw totals are not directly comparable with earlier runs. Remaining growth includes both corrected wide-producer accounting and conservative method-wide cleanup placement; it is not all individually necessary transition cleanup.
JIT executed-instruction counts increased approximately 0.011–0.031% on xarch; these are compiler-work measurements, not application-throughput results. The assembly runs report zero failing compilations, with symmetric missing-context counts between base and diff.
Validated with Checked x64/all-target JIT builds, focused execution and disassembly checks across default/AVX2/AVX/SSE/software configurations, targeted register-stress runs, and JIT formatting. Runtime execution was on Windows x64; cross-target replay is not runtime execution on those platforms.
Note
This PR description and implementation were prepared with GitHub Copilot assistance.