[mlir][linalg] Remove redundant indexOp builder.
authorTobias Gysi <gysit@google.com>
Fri, 7 May 2021 14:17:06 +0000 (14:17 +0000)
committerTobias Gysi <gysit@google.com>
Fri, 7 May 2021 14:22:12 +0000 (14:22 +0000)
Remove the builder signature taking a signed dimension identifier.

Reviewed By: ergawy

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

mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
mlir/lib/Dialect/Linalg/Transforms/Interchange.cpp

index b3046d2..dd5c2d5 100644 (file)
@@ -688,10 +688,6 @@ def Linalg_IndexOp : Linalg_Op<"index", [NoSideEffect]>,
     }
     ```
   }];
-  let builders = [
-    OpBuilder<(ins "int64_t":$dim),
-      [{ build($_builder, $_state, $_builder.getIndexType(), dim); }]>
-  ];
 
   let assemblyFormat = [{ $dim attr-dict `:` type($result) }];
 }
index fab957e..4ee534d 100644 (file)
@@ -153,8 +153,8 @@ generateFusedElementwiseOpRegion(PatternRewriter &rewriter, Operation *fusedOp,
         std::max(producer.getNumLoops(), consumer.getNumLoops());
     SmallVector<Value> fusedIndices;
     fusedIndices.reserve(numFusedOpLoops);
-    llvm::transform(llvm::seq<int64_t>(0, numFusedOpLoops),
-                    std::back_inserter(fusedIndices), [&](int64_t dim) {
+    llvm::transform(llvm::seq<uint64_t>(0, numFusedOpLoops),
+                    std::back_inserter(fusedIndices), [&](uint64_t dim) {
                       return rewriter.create<IndexOp>(producer.getLoc(), dim);
                     });
     for (IndexOp indexOp :
index 29acd62..6d13765 100644 (file)
@@ -93,8 +93,8 @@ void mlir::linalg::interchange(PatternRewriter &rewriter, LinalgOp op,
       rewriter.setInsertionPoint(indexOp);
       SmallVector<Value> allIndices;
       allIndices.reserve(op.getNumLoops());
-      llvm::transform(llvm::seq<int64_t>(0, op.getNumLoops()),
-                      std::back_inserter(allIndices), [&](int64_t dim) {
+      llvm::transform(llvm::seq<uint64_t>(0, op.getNumLoops()),
+                      std::back_inserter(allIndices), [&](uint64_t dim) {
                         return rewriter.create<IndexOp>(indexOp->getLoc(), dim);
                       });
       rewriter.replaceOpWithNewOp<AffineApplyOp>(