[PATCH] D71821: [LoopFusion] Move instructions from FC1.Preheader to FC0.Preheader when proven safe.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 25 15:13:46 PST 2019


jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

One more minor comment below, otherwise LGTM.



================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:485
+    I.moveBefore(MovePos);
+  }
+}
----------------
Whitney wrote:
> jdoerfert wrote:
> > `while (FromBB.size() > 1)` might be easier, with `*I = FromBB.front()`.
> > 
> > Why do you take the DT, PDT, DI? I would not or just them to `assert(isSafe..)`
> Forgot to add the isSafeToMoveBefore check, there is no need to check for this use case, but this utility can be use by user that didn't check beforehand. 
Fair.

With the while loop and front, you don't need the terminator check anymore.
For any non-broken IR this will work fine without.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71821





More information about the llvm-commits mailing list