aboutsummaryrefslogtreecommitdiff
path: root/mlir/tools
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/tools')
-rw-r--r--mlir/tools/mlir-lsp-server/CMakeLists.txt21
-rw-r--r--mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp1
-rw-r--r--mlir/tools/mlir-opt/CMakeLists.txt19
-rw-r--r--mlir/tools/mlir-opt/mlir-opt.cpp2
-rw-r--r--mlir/tools/mlir-pdll/mlir-pdll.cpp6
-rw-r--r--mlir/tools/mlir-query/CMakeLists.txt4
-rw-r--r--mlir/tools/mlir-reduce/CMakeLists.txt10
-rw-r--r--mlir/tools/mlir-rewrite/CMakeLists.txt10
-rw-r--r--mlir/tools/mlir-rewrite/mlir-rewrite.cpp1
-rw-r--r--mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp2
10 files changed, 25 insertions, 51 deletions
diff --git a/mlir/tools/mlir-lsp-server/CMakeLists.txt b/mlir/tools/mlir-lsp-server/CMakeLists.txt
index 6932e0f..0518620 100644
--- a/mlir/tools/mlir-lsp-server/CMakeLists.txt
+++ b/mlir/tools/mlir-lsp-server/CMakeLists.txt
@@ -2,8 +2,6 @@ set(LLVM_OPTIONAL_SOURCES
null.cpp
)
-get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
-get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
set(LLVM_LINK_COMPONENTS
Core
Support
@@ -35,22 +33,11 @@ if(MLIR_INCLUDE_TESTS)
endif()
set(LIBS
- ${conversion_libs}
- ${dialect_libs}
- ${extension_libs}
-
- MLIRAffineAnalysis
- MLIRAnalysis
- MLIRDialect
- MLIRFuncAllExtensions
MLIRLspServerLib
- MLIRParser
- MLIRPass
- MLIRTensorAllExtensions
- MLIRTransforms
- MLIRTransformUtils
- MLIRSupport
- MLIRIR
+
+ MLIRRegisterAllDialects
+ MLIRRegisterAllExtensions
+ MLIRRegisterAllPasses
)
add_mlir_tool(mlir-lsp-server
diff --git a/mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp b/mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp
index 6a759d9..10d602f 100644
--- a/mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp
+++ b/mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include "mlir/IR/DialectRegistry.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/InitAllDialects.h"
#include "mlir/InitAllExtensions.h"
diff --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt
index 6958fe3..7cc6e78 100644
--- a/mlir/tools/mlir-opt/CMakeLists.txt
+++ b/mlir/tools/mlir-opt/CMakeLists.txt
@@ -2,9 +2,6 @@ set(LLVM_OPTIONAL_SOURCES
null.cpp
)
-get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
-get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
-get_property(extension_libs GLOBAL PROPERTY MLIR_EXTENSION_LIBS)
set(LLVM_LINK_COMPONENTS
Core
Support
@@ -65,21 +62,11 @@ if(MLIR_INCLUDE_TESTS)
endif()
set(LIBS
- ${dialect_libs}
- ${conversion_libs}
- ${extension_libs}
- MLIRAffineAnalysis
- MLIRAnalysis
- MLIRCastInterfaces
- MLIRDialect
MLIROptLib
- MLIRParser
- MLIRPass
- MLIRTransforms
- MLIRTransformUtils
- MLIRSupport
- MLIRIR
+ MLIRRegisterAllDialects
+ MLIRRegisterAllExtensions
+ MLIRRegisterAllPasses
# TODO: Remove when registerAllGPUToLLVMIRTranslations is no longer
# registered directly in mlir-opt.cpp.
diff --git a/mlir/tools/mlir-opt/mlir-opt.cpp b/mlir/tools/mlir-opt/mlir-opt.cpp
index 2c09753..14714c45 100644
--- a/mlir/tools/mlir-opt/mlir-opt.cpp
+++ b/mlir/tools/mlir-opt/mlir-opt.cpp
@@ -135,6 +135,7 @@ void registerTestShardSimplificationsPass();
void registerTestMultiBuffering();
void registerTestNextAccessPass();
void registerTestNVGPULowerings();
+void registerTestOneShotModuleBufferizePass();
void registerTestOpaqueLoc();
void registerTestOpLoweringPasses();
void registerTestPadFusion();
@@ -281,6 +282,7 @@ void registerTestPasses() {
mlir::test::registerTestMultiBuffering();
mlir::test::registerTestNextAccessPass();
mlir::test::registerTestNVGPULowerings();
+ mlir::test::registerTestOneShotModuleBufferizePass();
mlir::test::registerTestOpaqueLoc();
mlir::test::registerTestOpLoweringPasses();
mlir::test::registerTestPadFusion();
diff --git a/mlir/tools/mlir-pdll/mlir-pdll.cpp b/mlir/tools/mlir-pdll/mlir-pdll.cpp
index 88a5f36..f99dcdb 100644
--- a/mlir/tools/mlir-pdll/mlir-pdll.cpp
+++ b/mlir/tools/mlir-pdll/mlir-pdll.cpp
@@ -201,6 +201,12 @@ int main(int argc, char **argv) {
llvm::raw_string_ostream outputStrOS(outputStr);
auto processFn = [&](std::unique_ptr<llvm::MemoryBuffer> chunkBuffer,
raw_ostream &os) {
+ // Split does not guarantee null-termination. Make a copy of the buffer to
+ // ensure null-termination.
+ if (!chunkBuffer->getBuffer().ends_with('\0')) {
+ chunkBuffer = llvm::MemoryBuffer::getMemBufferCopy(
+ chunkBuffer->getBuffer(), chunkBuffer->getBufferIdentifier());
+ }
return processBuffer(os, std::move(chunkBuffer), outputType, includeDirs,
dumpODS, includedFiles);
};
diff --git a/mlir/tools/mlir-query/CMakeLists.txt b/mlir/tools/mlir-query/CMakeLists.txt
index 1826397..1668bba 100644
--- a/mlir/tools/mlir-query/CMakeLists.txt
+++ b/mlir/tools/mlir-query/CMakeLists.txt
@@ -1,5 +1,3 @@
-get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
-
if(MLIR_INCLUDE_TESTS)
set(test_libs
MLIRTestDialect
@@ -12,8 +10,8 @@ add_mlir_tool(mlir-query
llvm_update_compile_flags(mlir-query)
mlir_target_link_libraries(mlir-query
PRIVATE
- ${dialect_libs}
MLIRQueryLib
+ MLIRRegisterAllDialects
)
target_link_libraries(mlir-query PRIVATE ${test_libs})
diff --git a/mlir/tools/mlir-reduce/CMakeLists.txt b/mlir/tools/mlir-reduce/CMakeLists.txt
index d71ac86..349d75b 100644
--- a/mlir/tools/mlir-reduce/CMakeLists.txt
+++ b/mlir/tools/mlir-reduce/CMakeLists.txt
@@ -1,6 +1,3 @@
-get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
-get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
-
if(MLIR_INCLUDE_TESTS)
set(test_libs
MLIRTestDialect
@@ -8,12 +5,9 @@ if(MLIR_INCLUDE_TESTS)
endif()
set(LIBS
- ${conversion_libs}
- ${dialect_libs}
- MLIRDialect
- MLIRIR
- MLIRPass
MLIRReduceLib
+ MLIRRegisterAllDialects
+ MLIRRegisterAllPasses
)
add_mlir_tool(mlir-reduce
diff --git a/mlir/tools/mlir-rewrite/CMakeLists.txt b/mlir/tools/mlir-rewrite/CMakeLists.txt
index 216491e..4120b175 100644
--- a/mlir/tools/mlir-rewrite/CMakeLists.txt
+++ b/mlir/tools/mlir-rewrite/CMakeLists.txt
@@ -1,21 +1,19 @@
-get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
set(LLVM_LINK_COMPONENTS
Support
)
set(LIBS
- ${dialect_libs}
-
MLIRAffineAnalysis
MLIRAnalysis
MLIRCastInterfaces
MLIRDialect
+ MLIRIR
MLIRParser
MLIRPass
- MLIRTransforms
- MLIRTransformUtils
+ MLIRRegisterAllDialects
MLIRSupport
- MLIRIR
+ MLIRTransformUtils
+ MLIRTransforms
)
include_directories(../../../clang/include)
diff --git a/mlir/tools/mlir-rewrite/mlir-rewrite.cpp b/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
index 87df9e1..fd8ae7e 100644
--- a/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
+++ b/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
@@ -24,6 +24,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/LineIterator.h"
+#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Regex.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/ToolOutputFile.h"
diff --git a/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp b/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
index dbae2143..3140f12 100644
--- a/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
+++ b/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
@@ -495,7 +495,7 @@ void DefGen::emitCheckedBuilder() {
MethodBody &body = m->body().indent();
auto scope = body.scope("return Base::getChecked(emitError, context", ");");
for (const auto &param : params)
- body << ", " << param.getName();
+ body << ", std::move(" << param.getName() << ")";
}
static SmallVector<MethodParameter>