-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Have certain mask simplification operations happen earlier than morph #117101
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
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
19e697d
to
307f762
Compare
307f762
to
882a885
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR moves certain mask simplification operations to occur earlier during the JIT morph phase, thereby reducing tree complexity and enabling further optimizations.
- Removed the dedicated FEATURE_MASKED_HW_INTRINSICS block from fgOptimizeHWIntrinsic.
- Updated mask checking functions in various locations to use IsMaskZero/IsMaskAllBitsSet instead of legacy IsFalseMask and IsCnsVec checks.
- Adjusted assertions and folding logic in both gentree.cpp and lowerarmarch.cpp to align with the new mask constant API.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/coreclr/jit/morph.cpp | Removed masked intrinsic optimization block and updated SIMD/mask type checks. |
src/coreclr/jit/lowerarmarch.cpp | Updated legacy false mask checks to the new IsMaskZero API for consistency. |
src/coreclr/jit/gentree.h | Replaced IsFalseMask with new IsMaskZero and IsMaskAllBitsSet methods. |
src/coreclr/jit/gentree.cpp | Updated folding logic and assertions to use new mask methods. |
src/coreclr/jit/compiler.h | Removed declarations for masked intrinsic helper functions no longer in use. |
Comments suppressed due to low confidence (4)
src/coreclr/jit/gentree.h:1808
- The legacy IsFalseMask method has been removed in favor of the more clearly named IsMaskZero. Ensure that the documentation and any related comments in client code are updated to reflect this naming change.
inline bool IsTrueMask(var_types simdBaseType) const;
CC. @dotnet/jit-contrib for review. This has some minimal improvements right now and will have greater impact once the changes to implicitly use the mask producing compares for V128/V256 goes in. -- I separated this out since its an independent improvement and helps isolate the V128/V256 changes to help assert they're doing the right things standalone |
(Resolved merge conflicts, no additional changes) |
Fixes dotnet#101970 Predicate variants were implemented in dotnet#114438 and then turned off in dotnet#115566. The code was then removed in dotnet#117101 when the AMD64 version was moved to from morph to folding. This is a simple rework of that code. Replaces dotnet#116854
This allows for shorter and less complex trees to persist throughout the lifetime of the JIT, leading to less overall work and more optimizations being possible when such masks are used.