[PATCH] D144492: [InstCombine] Support multiple comparisons in foldAllocaCmp()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 03:12:29 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:927
+      // object.
+      if (ICmp && ICmp->isEquality() && getUnderlyingObject(*U) == Alloca) {
+        // Collect equality icmps of the alloca, and don't treat them as
----------------
goldstein.w.n wrote:
> Can you add TODO to canonicalize `ule/uge/sle/sge` -> `ult/ugt/slt/sgt`?
I don't think that would be legal, because it effectively retains a capture of the alloca, through which the address may be determined or constrained, leading to a contradiction with another fold.


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

https://reviews.llvm.org/D144492



More information about the llvm-commits mailing list