[Mlir-commits] [mlir] 8358ddb - [mlir][spirv] NFC: Move test passes to test/lib
Lei Zhang
llvmlistbot at llvm.org
Mon Feb 24 11:17:10 PST 2020
Author: Lei Zhang
Date: 2020-02-24T14:17:02-05:00
New Revision: 8358ddbe5d32d9aaa371b3de69f4efabf309b450
URL: https://github.com/llvm/llvm-project/commit/8358ddbe5d32d9aaa371b3de69f4efabf309b450
DIFF: https://github.com/llvm/llvm-project/commit/8358ddbe5d32d9aaa371b3de69f4efabf309b450.diff
LOG: [mlir][spirv] NFC: Move test passes to test/lib
Previously C++ test passes for SPIR-V were put under
test/Dialect/SPIRV. Move them to test/lib/Dialect/SPIRV
to create a better structure.
Also fixed one of the test pass to use new
PassRegistration mechanism.
Differential Revision: https://reviews.llvm.org/D75066
Added:
mlir/test/lib/Dialect/CMakeLists.txt
mlir/test/lib/Dialect/SPIRV/CMakeLists.txt
mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp
Modified:
mlir/test/CMakeLists.txt
mlir/test/lib/CMakeLists.txt
mlir/tools/mlir-opt/mlir-opt.cpp
Removed:
mlir/test/Dialect/CMakeLists.txt
mlir/test/Dialect/SPIRV/CMakeLists.txt
mlir/test/Dialect/SPIRV/TestAvailability.cpp
################################################################################
diff --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt
index a277446a6074..e008bd62f892 100644
--- a/mlir/test/CMakeLists.txt
+++ b/mlir/test/CMakeLists.txt
@@ -1,4 +1,3 @@
-add_subdirectory(Dialect)
add_subdirectory(EDSC)
add_subdirectory(mlir-cpu-runner)
add_subdirectory(SDBM)
diff --git a/mlir/test/lib/CMakeLists.txt b/mlir/test/lib/CMakeLists.txt
index 534d0d31216d..591847802f7b 100644
--- a/mlir/test/lib/CMakeLists.txt
+++ b/mlir/test/lib/CMakeLists.txt
@@ -1,4 +1,5 @@
add_subdirectory(DeclarativeTransforms)
+add_subdirectory(Dialect)
add_subdirectory(IR)
add_subdirectory(Pass)
add_subdirectory(TestDialect)
diff --git a/mlir/test/Dialect/CMakeLists.txt b/mlir/test/lib/Dialect/CMakeLists.txt
similarity index 100%
rename from mlir/test/Dialect/CMakeLists.txt
rename to mlir/test/lib/Dialect/CMakeLists.txt
diff --git a/mlir/test/Dialect/SPIRV/CMakeLists.txt b/mlir/test/lib/Dialect/SPIRV/CMakeLists.txt
similarity index 100%
rename from mlir/test/Dialect/SPIRV/CMakeLists.txt
rename to mlir/test/lib/Dialect/SPIRV/CMakeLists.txt
diff --git a/mlir/test/Dialect/SPIRV/TestAvailability.cpp b/mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp
similarity index 97%
rename from mlir/test/Dialect/SPIRV/TestAvailability.cpp
rename to mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp
index 0055085c1661..0ebd3d8785fc 100644
--- a/mlir/test/Dialect/SPIRV/TestAvailability.cpp
+++ b/mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp
@@ -75,9 +75,12 @@ void PrintOpAvailability::runOnFunction() {
});
}
-static PassRegistration<PrintOpAvailability>
- printOpAvailabilityPass("test-spirv-op-availability",
- "Test SPIR-V op availability");
+namespace mlir {
+void registerPrintOpAvailabilityPass() {
+ PassRegistration<PrintOpAvailability> printOpAvailabilityPass(
+ "test-spirv-op-availability", "Test SPIR-V op availability");
+}
+} // namespace mlir
//===----------------------------------------------------------------------===//
// Converting target environment pass
diff --git a/mlir/tools/mlir-opt/mlir-opt.cpp b/mlir/tools/mlir-opt/mlir-opt.cpp
index 4df330e77bcd..291e31bfa6fe 100644
--- a/mlir/tools/mlir-opt/mlir-opt.cpp
+++ b/mlir/tools/mlir-opt/mlir-opt.cpp
@@ -32,6 +32,7 @@ void registerInliner();
void registerMemRefBoundCheck();
void registerPassManagerTestPass();
void registerPatternsTestPass();
+void registerPrintOpAvailabilityPass();
void registerSimpleParametricTilingPass();
void registerSymbolTestPasses();
void registerTestAffineDataCopyPass();
@@ -84,6 +85,7 @@ void registerTestPasses() {
registerMemRefBoundCheck();
registerPassManagerTestPass();
registerPatternsTestPass();
+ registerPrintOpAvailabilityPass();
registerSimpleParametricTilingPass();
registerSymbolTestPasses();
registerTestAffineDataCopyPass();
More information about the Mlir-commits
mailing list