[PATCH] D139934: [IndVars] Apply more optimistic SkipLastIter for AND/OR conditions

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 04:39:37 PST 2023


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1489
+      auto *WideMaxIter = SE->getNoopOrZeroExtend(MaxIter, WiderType);
+      if (SE->isKnownPredicate(ICmpInst::ICMP_EQ, WideExitMax, WideMaxIter))
+        ICmpsFailingOnLastIter.insert(ICmp);
----------------
nikic wrote:
> Would just `WideExitMax == WideMaxIter` be sufficient? Don't think we usually use isKnownPredicate for equality comparisons and rely on canonicalization instead.
I think it should be, in any practical sense.


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

https://reviews.llvm.org/D139934



More information about the llvm-commits mailing list