[PATCH] D135354: [LoopPredication] Insert assumes of conditions of predicated guards

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 00:09:20 PDT 2022


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopPredication.cpp:831
+  }
   RecursivelyDeleteTriviallyDeadInstructions(OldCond, nullptr /* TLI */, MSSAU);
 
----------------
dmakogon wrote:
> mkazantsev wrote:
> > mkazantsev wrote:
> > > It's no longer dead.
> > Move to `else` block.
> Actually it is dead. The OldCond here would be something like
> ```%explicit_guard_cond = and i1 %cond.1, %wc```
> and it is no longer used in a branch, however it makes use of widenable condition.
> So there are two uses of it: the new `and` inserted by LoopPredication and this old one.
> We require that widenable condition has exactly one use, so we have to remove it.
> `cond.1` is no longer dead, not this one
Ah, yes. agreed. Thanks!


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

https://reviews.llvm.org/D135354



More information about the llvm-commits mailing list