[mlir][linalg] Tune getTiedIndexingMap method (NFC).

Optimize the performance by using the range directly.

Reviewed By: benvanik

Differential Revision: https://reviews.llvm.org/D108715
This commit is contained in:
Tobias Gysi
2021-08-25 18:43:41 +00:00
parent 400a1de3ac
commit 2b35b372fd

View File

@@ -589,7 +589,9 @@ def LinalgStructuredInterface : OpInterface<"LinalgOp"> {
/*methodBody=*/"",
/*defaultImplementation=*/[{
assert(opOperand->getOwner() == this->getOperation());
return getIndexingMaps()[opOperand->getOperandNumber()];
auto indexingMaps =
$_op.indexing_maps().template getAsValueRange<AffineMapAttr>();
return *(indexingMaps.begin() + opOperand->getOperandNumber());
}]
>,
InterfaceMethod<