Uh oh!
There was an error while loading. Please reload this page.
JIT: Graph-based loop inversion - #113709
Conversation
Rewrite loop inversion to be graph based and to use the new loop representation.
… from old inversion
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
amanasifkhalid
commented
Mar 20, 2025
I can't repro the SPMI failures locally, and the assert This test is failing with an AV from an array access with an underflowing index Before inversion, we have the following layout: We invert this loop by cloning the check RBO determines that the preliminary checks can be removed since we know Assertion prop gets rid of the After this, range check elimination seems to think cc @EgorBo, seems like this exposed a range check bug? |
EgorBo
commented
Mar 20, 2025
Usually, this assert means that someone created a node in a phase that returned PhaseStatus::MODIFIED_NOTHING |
EgorBo
commented
Mar 20, 2025
can you provide the full jit dump? |
amanasifkhalid
commented
Mar 20, 2025
It hit during flow opts, I suspect it's one of the paths where
Sure: |
If |
amanasifkhalid
commented
Mar 21, 2025
Diffs are still large, and In these instances, loop unrolling isn't able to look before the hoisted loop checks to find the init value of the IV, so we leave the loops intact. In the baseline JIT, we produce straight-line code that's eventually collapsed into simple return logic. There are a few instances of similarly large improvements: In cases like With loop unrolling disabled, the diffs are considerably less severe: |
EgorBo
commented
Mar 25, 2025
@amanasifkhalid can you please re-base the PR to see if the range check issue still reproes with recent changes |
amanasifkhalid
commented
Mar 26, 2025
@EgorBo this failure repro'd in the latest run |
EgorBo
commented
Mar 26, 2025
@amanasifkhalid can you point me to a pipeline where the test failed? I presume it's not SPMI |
amanasifkhalid
commented
Mar 26, 2025
@EgorBo sure, it's failing in the |
EgorBo
commented
Mar 26, 2025
thanks, I can repro it locally |
EgorBo
commented
Mar 26, 2025
Ok, looks like RangeCheck gets confused by a range where lower bound is greater than the upper one |
So I filed a PR to fix this case #113935, but I'd recommend to disable the range check phase in your PR, because I suspect you have other issues so I don't expect the PR to become green once you disable the range check phase. Or you can integrate my PR (let's wait till its green) |
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Follow-up to #109346. cc @jakobbotsch, feel free to merge this back into your branch if you'd prefer to keep the old PR.