Uh oh!
There was an error while loading. Please reload this page.
JIT: Optimize ConditionalSelect with const zero when condition is not TYP_MASK - #113864
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
saucecontrol
commented
Mar 25, 2025
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
tannergooding
left a comment
There was a problem hiding this comment.
CC. @dotnet/jit-contrib, @EgorBo for secondary review
EgorBo
commented
Mar 27, 2025
/azp run Fuzzlyn |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
saucecontrol
commented
Apr 4, 2025
ping @tannergooding@EgorBo for merge |
| // If either of the value operands is const zero, we can optimize down to AND or AND_NOT. | ||
| GenTree* binOp = nullptr; | ||
| if (op3->IsVectorZero()) |
There was a problem hiding this comment.
can we have nodes of type ConvertMaskToVector(Vector.Zero) for op2 or op3. I just opened #114272 to fix a case where I was not checking that for arm64.
There was a problem hiding this comment.
I don't see a way we'd create that currently on xarch, but I plan on reviving #110342 and will keep that possibility in mind since we'll more eagerly choose intrinsics that produce a mask with that.
AVX-512 embedded masking relies on use of
ConditionalSelect, which makes this pattern common:This change improves codegen when the same pattern is used with a compare that does not produce a kmask result:
And more when
pblendvbis not available:Diffs show a few interesting variations in tests.