Skip to content

Commit ff8ed4d

Browse files
[mlir] Use llvm::copy (NFC) (#168213)
Identified with llvm-use-ranges.
1 parent b1b0be2 commit ff8ed4d

File tree

7 files changed

+8
-9
lines changed

7 files changed

+8
-9
lines changed

mlir/lib/Analysis/Presburger/IntegerRelation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,11 +2265,11 @@ IntegerRelation::unionBoundingBox(const IntegerRelation &otherCst) {
22652265
newLb[d] = lbFloorDivisor;
22662266
newUb[d] = -lbFloorDivisor;
22672267
// Copy over the symbolic part + constant term.
2268-
std::copy(minLb.begin(), minLb.end(), newLb.begin() + getNumDimVars());
2268+
llvm::copy(minLb, newLb.begin() + getNumDimVars());
22692269
std::transform(newLb.begin() + getNumDimVars(), newLb.end(),
22702270
newLb.begin() + getNumDimVars(),
22712271
std::negate<DynamicAPInt>());
2272-
std::copy(maxUb.begin(), maxUb.end(), newUb.begin() + getNumDimVars());
2272+
llvm::copy(maxUb, newUb.begin() + getNumDimVars());
22732273

22742274
boundingLbs.emplace_back(newLb);
22752275
boundingUbs.emplace_back(newUb);

mlir/lib/CAPI/IR/BuiltinTypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ MlirLogicalResult mlirMemRefTypeGetStridesAndOffset(MlirType type,
536536
if (failed(memrefType.getStridesAndOffset(strides_, *offset)))
537537
return mlirLogicalResultFailure();
538538

539-
(void)std::copy(strides_.begin(), strides_.end(), strides);
539+
(void)llvm::copy(strides_, strides);
540540
return mlirLogicalResultSuccess();
541541
}
542542

mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static bool doubleBuffer(Value oldMemRef, AffineForOp forOp) {
8282
ArrayRef<int64_t> oldShape = oldMemRefType.getShape();
8383
SmallVector<int64_t, 4> newShape(1 + oldMemRefType.getRank());
8484
newShape[0] = 2;
85-
std::copy(oldShape.begin(), oldShape.end(), newShape.begin() + 1);
85+
llvm::copy(oldShape, newShape.begin() + 1);
8686
return MemRefType::Builder(oldMemRefType).setShape(newShape).setLayout({});
8787
};
8888

mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,7 @@ static Value replaceByPackingResult(RewriterBase &rewriter,
913913
llvm_unreachable("loop independence prerequisite not met");
914914

915915
// offsets = [maybe_leading_ivs = originalLoopIvs, 0 .. 0].
916-
std::copy(loopIterationCounts.begin(), loopIterationCounts.end(),
917-
offsets.begin());
916+
llvm::copy(loopIterationCounts, offsets.begin());
918917
hoistedPackedTensor =
919918
scf::getForInductionVarOwner(packingResult.clonedLoopIvs.front())
920919
->getResult(0);

mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class SparseIterator {
197197
// Sets the iterate to the specified position.
198198
void seek(ValueRange vals) {
199199
assert(vals.size() == cursorValsCnt);
200-
std::copy(vals.begin(), vals.end(), cursorValsStorageRef.begin());
200+
llvm::copy(vals, cursorValsStorageRef.begin());
201201
// Now that the iterator is re-positioned, the coordinate becomes invalid.
202202
crd = nullptr;
203203
}

mlir/lib/Dialect/XeGPU/Utils/XeGPUUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ xegpu::extractVectorsWithShapeFromValue(OpBuilder &builder, Location loc,
308308
int64_t rankDiff = srcShapeRank - targetShapeRank;
309309
std::fill(adjustedTargetShape.begin(), adjustedTargetShape.begin() + rankDiff,
310310
1);
311-
std::copy(shape.begin(), shape.end(), adjustedTargetShape.begin() + rankDiff);
311+
llvm::copy(shape, adjustedTargetShape.begin() + rankDiff);
312312

313313
SmallVector<Value> result;
314314
for (SmallVector<int64_t> offsets :

mlir/lib/Tools/PDLL/AST/Nodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static StringRef copyStringWithNull(Context &ctx, StringRef str) {
2121
return str;
2222

2323
char *data = ctx.getAllocator().Allocate<char>(str.size() + 1);
24-
std::copy(str.begin(), str.end(), data);
24+
llvm::copy(str, data);
2525
data[str.size()] = 0;
2626
return StringRef(data, str.size());
2727
}

0 commit comments

Comments
 (0)