[Mlir-commits] [mlir] eb446eb - [MLIR][BUILD] Fix Unicode build issue on Windows. (#112300)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Oct 17 23:34:37 PDT 2024
Author: Harrison Hao
Date: 2024-10-18T14:34:33+08:00
New Revision: eb446eb4f71f0d4da3840ad7d77af5da59838f38
URL: https://github.com/llvm/llvm-project/commit/eb446eb4f71f0d4da3840ad7d77af5da59838f38
DIFF: https://github.com/llvm/llvm-project/commit/eb446eb4f71f0d4da3840ad7d77af5da59838f38.diff
LOG: [MLIR][BUILD] Fix Unicode build issue on Windows. (#112300)
This issue is from https://github.com/llvm/llvm-project/pull/77668. I
encountered a build issue because it used Unicode. When I built MLIR on
Windows with Visual Studio 2022, I faced a build failure.
---------
Co-authored-by: Harrison Hao <harrison.hao at amd.com>
Added:
Modified:
mlir/test/mlir-rewrite/simple.mlir
mlir/tools/mlir-rewrite/mlir-rewrite.cpp
Removed:
################################################################################
diff --git a/mlir/test/mlir-rewrite/simple.mlir b/mlir/test/mlir-rewrite/simple.mlir
index ab6bfe24fccf03..66f17f093f5094 100644
--- a/mlir/test/mlir-rewrite/simple.mlir
+++ b/mlir/test/mlir-rewrite/simple.mlir
@@ -4,8 +4,7 @@
func.func @two_dynamic_one_direct_shape(%arg0: tensor<?x4x?xf32>, %arg1: tensor<2x4x?xf32>) -> tensor<?x4x?xf32> {
// RENAME: "test.concat"({{.*}}) {bxis = 0 : i64}
- // RANGE: 《%{{.*}} = 〖"test.concat"〗({{.*}}) {axis = 0 : i64} : (tensor<?x4x?xf32>, tensor<2x4x?xf32>) -> tensor<?x4x?xf32>》
+ // RANGE: <%{{.*}} = ["test.concat"]({{.*}}) {axis = 0 : i64} : (tensor<?x4x?xf32>, tensor<2x4x?xf32>) -> tensor<?x4x?xf32>>
%5 = "test.concat"(%arg0, %arg1) {axis = 0 : i64} : (tensor<?x4x?xf32>, tensor<2x4x?xf32>) -> tensor<?x4x?xf32>
return %5 : tensor<?x4x?xf32>
}
-
diff --git a/mlir/tools/mlir-rewrite/mlir-rewrite.cpp b/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
index 308e6490726c86..e70aa5d41aa049 100644
--- a/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
+++ b/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
@@ -320,25 +320,25 @@ LogicalResult markRanges(RewritePad &rewriteState, raw_ostream &os) {
for (auto it : rewriteState.getOpDefs()) {
auto [startOp, endOp] = getOpRange(it);
- rewriteState.insertText(startOp, "《");
- rewriteState.insertText(endOp, "》");
+ rewriteState.insertText(startOp, "<");
+ rewriteState.insertText(endOp, ">");
auto nameRange = getOpNameRange(it);
if (isGeneric(it)) {
- rewriteState.insertText(nameRange.Start, "〖");
- rewriteState.insertText(nameRange.End, "〗");
+ rewriteState.insertText(nameRange.Start, "[");
+ rewriteState.insertText(nameRange.End, "]");
} else {
- rewriteState.insertText(nameRange.Start, "〔");
- rewriteState.insertText(nameRange.End, "〕");
+ rewriteState.insertText(nameRange.Start, "![");
+ rewriteState.insertText(nameRange.End, "]!");
}
}
// Highlight all comment lines.
// TODO: Could be replaced if this is kept in memory.
for (auto commentLine : rewriteState.getSingleLineComments()) {
- rewriteState.insertText(commentLine.Start, "❰");
- rewriteState.insertText(commentLine.End, "❱");
+ rewriteState.insertText(commentLine.Start, "{");
+ rewriteState.insertText(commentLine.End, "}");
}
return success();
More information about the Mlir-commits
mailing list