[PATCH] D138269: [LoopFusion] Exit early if one of fusion candidate has guarded branch but the another has not

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 00:24:15 PST 2022


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

Not familiar with this pass, but it looks reasonable.



================
Comment at: llvm/lib/Transforms/Scalar/LoopFuse.cpp:898
 
-          if (!FC0->GuardBranch && FC1->GuardBranch) {
-            LLVM_DEBUG(dbgs() << "The second candidate is guarded while the "
-                                 "first one is not. Not fusing.\n");
+          if (!FC0->GuardBranch != !FC1->GuardBranch) {
+            LLVM_DEBUG(dbgs() << "The one of candidate is guarded while the "
----------------
nit: I'd prefer doing a `(bool)` cast or something, the `! != !` is pretty weird.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138269



More information about the llvm-commits mailing list