[llvm] [LoopRotate] Remove canRotateDeoptimizingLatchExit and multi-rotate (PR #162482)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 8 07:06:34 PDT 2025
annamthomas wrote:
> > The canRotateDeoptimizingLatchExit check does not seem to work as intended. It was introduced in https://gitlab.azulsystems.com/dev/orca/-/commit/2f6987ba61cc31c16c64f511e5cbc76b52dc67b3 for the loop-rotate-multi-flag, where this flag was disabled and there was an intent to enable it by default later (https://reviews.llvm.org/D73058) and this has not happen even 5 years later.
>
> Note that the first reference here is non-public, was that intentional?
@mark-sed pls note above comment! Pls reference the original LLVM Phabricator review (or llvm commit). Also, pls update the commit MR to state why exactly the current heuristic doesn't work as intended without the multi-rotate option (thats an important detail apart from the fact that the multi-rotate option is off by default).
"The heuristic in canRotateDeoptimizingLatchExit returns true if *any* of the loop exits are non-deoptimizing. This means if the loop has multiple deopt exits, then without multi-rotate, we may still end up having deopt exit at the latch. This multi-rotate option is introduced but it is off by default. We have not seen any improvements downstream as well, where we have deoptimizations significantly in IR. Since the original heuristic without the multi-rotate effectively ends up being "rotate under some conditions", but the loop may still not be in the form we want, we should remove the heuristic and multi-rotate framework entirely"
https://github.com/llvm/llvm-project/pull/162482
More information about the llvm-commits
mailing list