forked from OSchip/llvm-project
[mlir] Apply ClangTidyPerformance findings (NFC)
This commit is contained in:
parent
efe1527e28
commit
07628a94e8
|
@ -117,7 +117,7 @@ SmallVector<OpFoldResult> permuteValues(ArrayRef<OpFoldResult> values,
|
|||
AffineMap map) {
|
||||
assert(map.isPermutation());
|
||||
SmallVector<OpFoldResult> permutedValues(values.size());
|
||||
for (auto position :
|
||||
for (const auto &position :
|
||||
llvm::enumerate(llvm::map_range(map.getResults(), [](AffineExpr expr) {
|
||||
return expr.cast<AffineDimExpr>().getPosition();
|
||||
})))
|
||||
|
@ -334,7 +334,7 @@ DecomposeLinalgOp::matchAndRewrite(GenericOp genericOp,
|
|||
/// In the split operations, replace block arguments uses that refer to
|
||||
/// original operation to the block arguments of the newly created operation.
|
||||
unsigned origNumInputs = genericOp.getNumInputs();
|
||||
for (auto inputBlockArg :
|
||||
for (const auto &inputBlockArg :
|
||||
llvm::enumerate(genericOp.getBody()->getArguments())) {
|
||||
Value residualOpReplacementArg =
|
||||
residualGenericOpBody->getArgument(inputBlockArg.index());
|
||||
|
@ -356,7 +356,7 @@ DecomposeLinalgOp::matchAndRewrite(GenericOp genericOp,
|
|||
/// corresponding result have to be remapped to result of the generic op for
|
||||
/// the peeled operation.
|
||||
SmallVector<Value> replacements;
|
||||
for (auto yieldValue : llvm::enumerate(yieldOp->getOperands())) {
|
||||
for (const auto &yieldValue : llvm::enumerate(yieldOp->getOperands())) {
|
||||
OpResult opr = yieldValue.value().dyn_cast<OpResult>();
|
||||
if (!opr || opr.getOwner() != peeledScalarOperation)
|
||||
replacements.push_back(residualGenericOp.getResult(yieldValue.index()));
|
||||
|
|
|
@ -160,12 +160,12 @@ struct LinalgOpTilingInterface
|
|||
if (!indexingMap.isPermutation()) {
|
||||
SmallVector<Range> iterationDomain =
|
||||
tilingInterfaceOp.getIterationDomain(b);
|
||||
for (auto range : llvm::enumerate(iterationDomain)) {
|
||||
for (const auto &range : llvm::enumerate(iterationDomain)) {
|
||||
iterationTileOffsets[range.index()] = range.value().offset;
|
||||
iterationTileSizes[range.index()] = range.value().size;
|
||||
}
|
||||
}
|
||||
for (auto resultExpr : llvm::enumerate(indexingMap.getResults())) {
|
||||
for (const auto &resultExpr : llvm::enumerate(indexingMap.getResults())) {
|
||||
unsigned dimPosition =
|
||||
resultExpr.value().cast<AffineDimExpr>().getPosition();
|
||||
iterationTileOffsets[dimPosition] = offsets[resultExpr.index()];
|
||||
|
|
Loading…
Reference in New Issue