[PATCH] D93734: [LoopDeletion] Insert an early exit from dead path in loop

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 07:13:37 PST 2021


jdoerfert added a comment.

What is left after we merged the loop unswitch solution?



================
Comment at: llvm/lib/Transforms/Scalar/LoopDeletion.cpp:110
   for (auto &I : L->blocks())
-    if (any_of(*I, [](Instruction &I) {
-          return I.mayHaveSideEffects() && !I.isDroppable();
-        }))
+    if (BBHasSideEffects(I))
       return false;
----------------
jonpa wrote:
> jdoerfert wrote:
> > DriveBy:
> > 
> > This hurts. I know it was there before but `auto &I` is `BasicBlock *`... argh.
> > Could we please change that if we commit this to a `auto *` at least with a sensible variable name.
> I think it's better in that case perhaps to just commit such an NFC change separately beforehand?
> 
Yeah, stuff like that can be committed directly as NFC.


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

https://reviews.llvm.org/D93734



More information about the llvm-commits mailing list