Uh oh!
There was an error while loading. Please reload this page.
Update fgMorphSmpOp to canonicalize commutative and compare ops at the start of POST-ORDER - #127661
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
This PR adjusts CoreCLR JIT morphing to canonicalize operand ordering for commutative operators and comparisons at the start of fgMorphSmpOp post-order processing, improving consistency and enabling post-order optimizations that rely on constants being placed predictably.
Changes:
- Canonicalize commutative and comparison trees in
fgMorphSmpOppost-order by swapping when the left operand is a constant (and swapping relops as needed). - Move the
((a % pow2) ==/!= 0) => (a & (pow2-1) ==/!= 0)pattern optimization from pre-order into theGT_EQ/GT_NEpost-order handling. - Strengthen/debug-guard morphing assumptions by asserting
fgMorphTreeis not invoked during the value-number CSE phase.
…e start of POST-ORDER
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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
commented
May 2, 2026
@EgorBo, this should be ready now. There's a few regressions where folding looks to stop happening. It needs to be investigated, but I don't think we should block on it. There's likely some other places that aren't looking for or handling the right edges. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
EgorBo
commented
May 2, 2026
any idea why osx-arm64 seems to be a pure regression? |
tannergooding
commented
May 2, 2026
It has more opts being done, in part because it has a higher ISA baseline. |
No description provided.