[mlir][linalg] Remove redundant indexOp builder.

Remove the builder signature taking a signed dimension identifier.

Reviewed By: ergawy

Differential Revision: https://reviews.llvm.org/D102055
This commit is contained in:
Tobias Gysi 2021-05-07 14:17:06 +00:00
parent faab8c140a
commit f31531a30b
3 changed files with 4 additions and 8 deletions

View 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) }];
}

View 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 :

View 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>(