[Mlir-commits] [mlir] [mlir] Fixing a regression that '-D' option of llvm-tblgen is unregistered. (PR #91329)
Daniel Chen
llvmlistbot at llvm.org
Tue May 7 12:38:25 PDT 2024
https://github.com/DanielCChen updated https://github.com/llvm/llvm-project/pull/91329
>From c0b08da56609dc9f2cb539a49ce7f77d5fe7ae71 Mon Sep 17 00:00:00 2001
From: cdchen-ca <cdchen at ca.ibm.com>
Date: Tue, 7 May 2024 09:56:24 -0400
Subject: [PATCH 1/2] [mlir] Fixing a regression that '-D' option of
llvm-tblgen is unregistered.
---
mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp b/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp
index dc1e2939c7d25b..c29455f00c2f07 100644
--- a/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp
+++ b/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp
@@ -62,6 +62,14 @@ int main(int argc, char **argv) {
"write-if-changed",
llvm::cl::desc("Only write to the output file if it changed"));
+ // `ResetCommandLineParser` at the above unregistered the "D" option
+ // of `llvm-tblgen`, which caused `TestOps.cpp` to fail due to
+ // "Unknnown command line argument '-D...`" when a macros name is
+ // present. The following is a workaround to re-register it again.
+ llvm::cl::list<std::string> MacroNames(
+ "D", llvm::cl::desc("Name of the macro to be defined"),
+ llvm::cl::value_desc("macro name"), llvm::cl::Prefix);
+
llvm::InitLLVM y(argc, argv);
llvm::cl::ParseCommandLineOptions(argc, argv);
>From e43264439e06364b17307bc04fe5183a391fd143 Mon Sep 17 00:00:00 2001
From: cdchen-ca <cdchen at ca.ibm.com>
Date: Tue, 7 May 2024 15:38:00 -0400
Subject: [PATCH 2/2] [mlir] Document -D is ignored by mlir-src-sharder.
---
mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp b/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp
index c29455f00c2f07..5bfc24ef3b479d 100644
--- a/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp
+++ b/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp
@@ -67,7 +67,9 @@ int main(int argc, char **argv) {
// "Unknnown command line argument '-D...`" when a macros name is
// present. The following is a workaround to re-register it again.
llvm::cl::list<std::string> MacroNames(
- "D", llvm::cl::desc("Name of the macro to be defined"),
+ "D",
+ llvm::cl::desc(
+ "Name of the macro to be defined -- ignored by mlir-src-sharder"),
llvm::cl::value_desc("macro name"), llvm::cl::Prefix);
llvm::InitLLVM y(argc, argv);
More information about the Mlir-commits
mailing list