[PATCH] D102234: [SimpleLoopBoundSplit] Split Bound of Loop which has conditional branch with IV

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 6 20:47:41 PDT 2021


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp:355
+  Instruction *OrigBI = PostLoopPreHeader->getTerminator();
+  ICmpInst::Predicate Pred = ICmpInst::ICMP_NE;
+  Value *Cond =
----------------
jaykang10 wrote:
> mkazantsev wrote:
> > Two points here:
> > 1. Functional concern. Will NE work ok for step other than 1?
> > 2. `lt` generally gives more info to the opt than `ne` (at least because `lt` implies `ne`). Any reason for `ne` here?
> I have tried to follow below comment from @reames.
> 
> > The "if (i != N)" is a loop guard and can be identified by getLoopGuardBranch.
> 
> I was also not sure whether `ne` is better than `lt` here...
I heard (and this info may be imprecise, out-of-date etc) that some parts of vectorization treat `ne` as its canonical form and don't recognize `lt`. As for me, it should never be a problem (`lt` always implies `ne`), but in practice it could be, just because how things are written now. I was asking if you are trying to deal with one of such cases, or it doesn't really matter. If it doesn't, `lt` is definitely better because it gives more info.


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

https://reviews.llvm.org/D102234



More information about the llvm-commits mailing list