[PATCH] D74330: [mlir][AffineOps] Adds affine loop fusion transformation function to LoopFusionUtils.

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 20:49:27 PST 2020


bondhugula accepted this revision.
bondhugula added a comment.

Looks good to me; just a few minor doc comments.



================
Comment at: mlir/test/lib/Transforms/TestLoopFusion.cpp:76
 // in range ['loopDepth' + 1, 'maxLoopDepth'].
 // Emits a remark on 'loops[i]' if a fusion-preventing dependence exists.
+static bool testDependenceCheck(AffineForOp srcForOp, AffineForOp dstForOp,
----------------
Document return value?


================
Comment at: mlir/test/lib/Transforms/TestLoopFusion.cpp:128
 // Emits a string representation of the slice union as a remark on 'loops[j]'.
-static void testSliceComputation(SmallVector<AffineForOp, 2> &loops, unsigned i,
-                                 unsigned j, unsigned loopDepth,
+static bool testSliceComputation(AffineForOp forOpA, AffineForOp forOpB,
+                                 unsigned i, unsigned j, unsigned loopDepth,
----------------
Document return value. 


================
Comment at: mlir/test/lib/Transforms/TestLoopFusion.cpp:143
 
-void TestLoopFusion::runOnFunction() {
-  // Gather all AffineForOps by loop depth.
-  DenseMap<unsigned, SmallVector<AffineForOp, 2>> depthToLoops;
-  for (auto &block : getFunction()) {
-    gatherLoops(&block, /*currLoopDepth=*/0, depthToLoops);
+static bool testLoopFusionTransformation(AffineForOp forOpA, AffineForOp forOpB,
+                                         unsigned i, unsigned j,
----------------
Function doc comment. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74330





More information about the llvm-commits mailing list