[Mlir-commits] [mlir] b13415b - [mlir][Linalg] Add dependence type to LinalgDependenceGraphElem.

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Nov 17 16:33:23 PST 2020


Author: MaheshRavishankar
Date: 2020-11-17T16:32:57-08:00
New Revision: b13415b59b1fbb01da0914678018c7e0eefa3291

URL: https://github.com/llvm/llvm-project/commit/b13415b59b1fbb01da0914678018c7e0eefa3291
DIFF: https://github.com/llvm/llvm-project/commit/b13415b59b1fbb01da0914678018c7e0eefa3291.diff

LOG: [mlir][Linalg] Add dependence type to LinalgDependenceGraphElem.

Differential Revision: https://reviews.llvm.org/D91502

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h
    mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h b/mlir/include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h
index f27b929f2fc0..4ee5fac7f677 100644
--- a/mlir/include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h
+++ b/mlir/include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h
@@ -44,6 +44,7 @@ class Aliases {
 /// views as SSA values.
 class LinalgDependenceGraph {
 public:
+  enum DependenceType { RAR = 0, RAW, WAR, WAW, NumTypes };
   struct LinalgOpView {
     Operation *op;
     unsigned operandIndex;
@@ -57,13 +58,14 @@ class LinalgDependenceGraph {
     //   1. src in the case of dependencesFromDstGraphs.
     //   2. dst in the case of dependencesIntoGraphs.
     LinalgOpView indexingOpView;
+    // Type of the dependence.
+    DependenceType dependenceType;
   };
   using LinalgDependences = SmallVector<LinalgDependenceGraphElem, 8>;
   using DependenceGraph = DenseMap<Operation *, LinalgDependences>;
   using dependence_iterator = LinalgDependences::const_iterator;
   using dependence_range = iterator_range<dependence_iterator>;
 
-  enum DependenceType { RAR = 0, RAW, WAR, WAW, NumTypes };
   static StringRef getDependenceTypeStr(DependenceType depType);
 
   // Builds a linalg dependence graph for the ops of type LinalgOp under `f`.

diff  --git a/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp b/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp
index 0a49cac6a65a..99e2e6ab07f2 100644
--- a/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp
+++ b/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp
@@ -116,9 +116,9 @@ void LinalgDependenceGraph::addDependenceElem(DependenceType dt,
                     << ") -> \n\t\t(" << *dependentOpView.op << ", "
                     << dependentOpView.operandIndex << ")");
   dependencesFromGraphs[dt][indexingOpView.op].push_back(
-      LinalgDependenceGraphElem{dependentOpView, indexingOpView});
+      LinalgDependenceGraphElem{dependentOpView, indexingOpView, dt});
   dependencesIntoGraphs[dt][dependentOpView.op].push_back(
-      LinalgDependenceGraphElem{indexingOpView, dependentOpView});
+      LinalgDependenceGraphElem{indexingOpView, dependentOpView, dt});
 }
 
 LinalgDependenceGraph::dependence_range


        


More information about the Mlir-commits mailing list