[PATCH] D135017: [LV] Move exit cond simplification to separate transform.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 26 03:09:40 PST 2022


Ayal added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:486
+  ScalarEvolution &SE = *PSE.getSE();
+  if (!C || ExitCount->isZero() ||
+      C->getAPInt().getZExtValue() > BestVF.getKnownMinValue() * BestUF)
----------------
fhahn wrote:
> Ayal wrote:
> > nit: is the isZero() check needed?
> Yes for now I think; if it is zero then the `+1` overflowed and this check is the same as in the previous version of the code.
Right, this is what the previous version was doing, and zero stands for a wrapped-around maximal BTC. But  CheckMinIters bails out in such (Max iteration) cases nonetheless, w/o reaching the latch? Probably deserves a comment and/or could be simplified into `C->isZero()`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135017



More information about the llvm-commits mailing list