Skip to content

Commit c2bff6c

Browse files
kazutakahirataJaddyen
authored andcommitted
[mlir] Use llvm::replace (NFC) (llvm#140344)
1 parent 9d92ecc commit c2bff6c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ LLVM::InlineAsmOp PtxBuilder::build() {
130130

131131
// Tablegen doesn't accept $, so we use %, but inline assembly uses $.
132132
// Replace all % with $
133-
std::replace(ptxInstruction.begin(), ptxInstruction.end(), '%', '$');
133+
llvm::replace(ptxInstruction, '%', '$');
134134

135135
return rewriter.create<LLVM::InlineAsmOp>(
136136
interfaceOp->getLoc(),

mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2402,7 +2402,7 @@ std::string mlir::linalg::generateLibraryCallName(Operation *op) {
24022402
}
24032403
}
24042404
name.reserve(128);
2405-
std::replace(name.begin(), name.end(), '.', '_');
2405+
llvm::replace(name, '.', '_');
24062406
llvm::raw_string_ostream ss(name);
24072407
ss << "_" << fun;
24082408
for (Type t : op->getOperandTypes()) {

mlir/lib/Transforms/ViewOpGraph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ class PrintOpPass : public impl::ViewOpGraphBase<PrintOpPass> {
292292
operand.printAsOperand(os, OpPrintingFlags());
293293
});
294294
// Replace % and # with _
295-
std::replace(str.begin(), str.end(), '%', '_');
296-
std::replace(str.begin(), str.end(), '#', '_');
295+
llvm::replace(str, '%', '_');
296+
llvm::replace(str, '#', '_');
297297
return str;
298298
}
299299

0 commit comments

Comments
 (0)