[PATCH] D143726: [LoopInstSimplify] Simplify (X < A && X < B) into (X < MIN(A, B)) if MIN(A, B) is loop-invariant

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 23:29:27 PST 2023


nikic added a comment.

My high level question would be whether this should be part of LICM. Basically, what we're doing here is a reassociation transform to expose a loop invariant, which can then be hoisted. This recently also came up in other contexts, e.g. D143631 <https://reviews.llvm.org/D143631>.

It looks like currently LoopInstSimplify is scheduled before LICM, so the operands might not have been hoisted yet. Having LICM rewrite expressions to enable hoisting would make sure that operands are hoisted first.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143726/new/

https://reviews.llvm.org/D143726



More information about the llvm-commits mailing list