[PATCH] D65464: [LoopFusion] Add ability to fuse guarded loops

Whitney via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 15:00:55 PDT 2019


Whitney added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopFuse.cpp:257
+
+  bool isRotated() const {
+    assert(L && "Expecting loop to be valid.");
----------------
I am thinking if we should have this function in Loop class.


================
Comment at: llvm/lib/Transforms/Scalar/LoopFuse.cpp:1037
+  /// If the two candidates are guarded loops, then it checks whether the
+  /// successor of the \p FC0 guard branch is the entry block of \p FC1. If not,
+  /// then the loops are not adjacent.
----------------
whether the non loop successor of the \p FC0 guard branch is the entry block of \p FC1.


================
Comment at: llvm/lib/Transforms/Scalar/LoopFuse.cpp:1347
+  ///    4. Remove the preheader for FC1.
+  ///  The successor for the latch of FC0 is updated to be the body for FC1 and
+  /// the successor of the latch for FC1 is updated to be the body of FC0, thus
----------------
Do you think something like this is more precise?  `The exit block successor for the latch of FC0 is updated to be the header of FC1 and the non exit block successor of the latch of FC1 is updated to be the header of FC0....`


================
Comment at: llvm/lib/Transforms/Scalar/LoopFuse.cpp:1570
+
+    FuseCounter++;
+
----------------
reportLoopFusion<OptimizationRemark>(*FC0, *FC1, FuseCounter);


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65464





More information about the llvm-commits mailing list