[Mlir-commits] [mlir] 3fef2d2 - [mlir][NFC] Move passes in test/lib/Transforms/ to a directory that mirrors what they test

River Riddle llvmlistbot at llvm.org
Fri May 14 10:36:00 PDT 2021


Author: River Riddle
Date: 2021-05-14T10:28:11-07:00
New Revision: 3fef2d26a31443b446e9885dcb1a8f86e698864f

URL: https://github.com/llvm/llvm-project/commit/3fef2d26a31443b446e9885dcb1a8f86e698864f
DIFF: https://github.com/llvm/llvm-project/commit/3fef2d26a31443b446e9885dcb1a8f86e698864f.diff

LOG: [mlir][NFC] Move passes in test/lib/Transforms/ to a directory that mirrors what they test

test/lib/Transforms/ has bitrot and become somewhat of a dumping grounds for testing pretty much any part of the project. This revision cleans this up, and moves the files within to a directory that reflects what is actually being tested.

Differential Revision: https://reviews.llvm.org/D102456

Added: 
    mlir/test/lib/Analysis/TestCallGraph.cpp
    mlir/test/lib/Analysis/TestLiveness.cpp
    mlir/test/lib/Analysis/TestMemRefBoundCheck.cpp
    mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
    mlir/test/lib/Analysis/TestMemRefStrideCalculation.cpp
    mlir/test/lib/Analysis/TestNumberOfExecutions.cpp
    mlir/test/lib/Conversion/CMakeLists.txt
    mlir/test/lib/Conversion/StandardToLLVM/CMakeLists.txt
    mlir/test/lib/Conversion/StandardToLLVM/TestConvertCallOp.cpp
    mlir/test/lib/Dialect/Affine/TestAffineLoopParametricTiling.cpp
    mlir/test/lib/Dialect/DLTI/CMakeLists.txt
    mlir/test/lib/Dialect/DLTI/TestDataLayoutQuery.cpp
    mlir/test/lib/Dialect/GPU/CMakeLists.txt
    mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToCubin.cpp
    mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToHsaco.cpp
    mlir/test/lib/Dialect/GPU/TestGpuMemoryPromotion.cpp
    mlir/test/lib/Dialect/GPU/TestGpuParallelLoopMapping.cpp
    mlir/test/lib/Dialect/GPU/TestGpuRewrite.cpp
    mlir/test/lib/Dialect/Linalg/CMakeLists.txt
    mlir/test/lib/Dialect/Linalg/TestConvVectorization.cpp
    mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp
    mlir/test/lib/Dialect/Linalg/TestLinalgElementwiseFusion.cpp
    mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp
    mlir/test/lib/Dialect/Linalg/TestLinalgHoisting.cpp
    mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp
    mlir/test/lib/Dialect/Math/CMakeLists.txt
    mlir/test/lib/Dialect/Math/TestExpandTanh.cpp
    mlir/test/lib/Dialect/Math/TestPolynomialApproximation.cpp
    mlir/test/lib/Dialect/SCF/CMakeLists.txt
    mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp
    mlir/test/lib/Dialect/StandardOps/CMakeLists.txt
    mlir/test/lib/Dialect/StandardOps/TestComposeSubView.cpp
    mlir/test/lib/Dialect/StandardOps/TestDecomposeCallGraphTypes.cpp
    mlir/test/lib/Dialect/Vector/CMakeLists.txt
    mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp
    mlir/test/lib/IR/TestDominance.cpp
    mlir/test/lib/IR/TestOpaqueLoc.cpp
    mlir/test/lib/Pass/TestDynamicPipeline.cpp

Modified: 
    mlir/test/lib/Analysis/CMakeLists.txt
    mlir/test/lib/CMakeLists.txt
    mlir/test/lib/Dialect/Affine/CMakeLists.txt
    mlir/test/lib/Dialect/CMakeLists.txt
    mlir/test/lib/IR/CMakeLists.txt
    mlir/test/lib/Pass/CMakeLists.txt
    mlir/test/lib/Transforms/CMakeLists.txt
    mlir/test/lib/Transforms/TestConstantFold.cpp
    mlir/tools/mlir-opt/CMakeLists.txt

Removed: 
    mlir/test/lib/Transforms/TestAffineLoopParametricTiling.cpp
    mlir/test/lib/Transforms/TestCallGraph.cpp
    mlir/test/lib/Transforms/TestComposeSubView.cpp
    mlir/test/lib/Transforms/TestConvVectorization.cpp
    mlir/test/lib/Transforms/TestConvertCallOp.cpp
    mlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp
    mlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp
    mlir/test/lib/Transforms/TestDataLayoutQuery.cpp
    mlir/test/lib/Transforms/TestDecomposeCallGraphTypes.cpp
    mlir/test/lib/Transforms/TestDominance.cpp
    mlir/test/lib/Transforms/TestDynamicPipeline.cpp
    mlir/test/lib/Transforms/TestExpandTanh.cpp
    mlir/test/lib/Transforms/TestGpuMemoryPromotion.cpp
    mlir/test/lib/Transforms/TestGpuParallelLoopMapping.cpp
    mlir/test/lib/Transforms/TestGpuRewrite.cpp
    mlir/test/lib/Transforms/TestLinalgCodegenStrategy.cpp
    mlir/test/lib/Transforms/TestLinalgElementwiseFusion.cpp
    mlir/test/lib/Transforms/TestLinalgFusionTransforms.cpp
    mlir/test/lib/Transforms/TestLinalgHoisting.cpp
    mlir/test/lib/Transforms/TestLinalgTransforms.cpp
    mlir/test/lib/Transforms/TestLiveness.cpp
    mlir/test/lib/Transforms/TestMemRefBoundCheck.cpp
    mlir/test/lib/Transforms/TestMemRefDependenceCheck.cpp
    mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
    mlir/test/lib/Transforms/TestNumberOfExecutions.cpp
    mlir/test/lib/Transforms/TestOpaqueLoc.cpp
    mlir/test/lib/Transforms/TestPolynomialApproximation.cpp
    mlir/test/lib/Transforms/TestSCFUtils.cpp
    mlir/test/lib/Transforms/TestVectorTransforms.cpp


################################################################################
diff  --git a/mlir/test/lib/Analysis/CMakeLists.txt b/mlir/test/lib/Analysis/CMakeLists.txt
index cecca328af0f5..07f5bde4e2db0 100644
--- a/mlir/test/lib/Analysis/CMakeLists.txt
+++ b/mlir/test/lib/Analysis/CMakeLists.txt
@@ -1,17 +1,20 @@
 # Exclude tests from libMLIR.so
 add_mlir_library(MLIRTestAnalysis
   TestAliasAnalysis.cpp
+  TestCallGraph.cpp
+  TestLiveness.cpp
+  TestMemRefBoundCheck.cpp
+  TestMemRefDependenceCheck.cpp
+  TestMemRefStrideCalculation.cpp
+  TestNumberOfExecutions.cpp
 
-  EXCLUDE_FROM_LIBMLIR
-
-  ADDITIONAL_HEADER_DIRS
-  ${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms
 
-  DEPENDS
-  MLIRStandardOpsIncGen
+  EXCLUDE_FROM_LIBMLIR
 
   LINK_LIBS PUBLIC
+  MLIRAffine
   MLIRAnalysis
+  MLIRMemRef
   MLIRPass
   MLIRTestDialect
   )

diff  --git a/mlir/test/lib/Transforms/TestCallGraph.cpp b/mlir/test/lib/Analysis/TestCallGraph.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestCallGraph.cpp
rename to mlir/test/lib/Analysis/TestCallGraph.cpp

diff  --git a/mlir/test/lib/Transforms/TestLiveness.cpp b/mlir/test/lib/Analysis/TestLiveness.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestLiveness.cpp
rename to mlir/test/lib/Analysis/TestLiveness.cpp

diff  --git a/mlir/test/lib/Transforms/TestMemRefBoundCheck.cpp b/mlir/test/lib/Analysis/TestMemRefBoundCheck.cpp
similarity index 97%
rename from mlir/test/lib/Transforms/TestMemRefBoundCheck.cpp
rename to mlir/test/lib/Analysis/TestMemRefBoundCheck.cpp
index 1188cc48ff7f1..a453d9f386833 100644
--- a/mlir/test/lib/Transforms/TestMemRefBoundCheck.cpp
+++ b/mlir/test/lib/Analysis/TestMemRefBoundCheck.cpp
@@ -15,7 +15,6 @@
 #include "mlir/Analysis/AffineStructures.h"
 #include "mlir/Analysis/Utils.h"
 #include "mlir/Dialect/Affine/IR/AffineOps.h"
-#include "mlir/Dialect/StandardOps/IR/Ops.h"
 #include "mlir/IR/Builders.h"
 #include "mlir/Pass/Pass.h"
 #include "llvm/ADT/TypeSwitch.h"

diff  --git a/mlir/test/lib/Transforms/TestMemRefDependenceCheck.cpp b/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
similarity index 99%
rename from mlir/test/lib/Transforms/TestMemRefDependenceCheck.cpp
rename to mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
index 3e96ca6450caf..b3f56a58f3c3f 100644
--- a/mlir/test/lib/Transforms/TestMemRefDependenceCheck.cpp
+++ b/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
@@ -14,7 +14,6 @@
 #include "mlir/Analysis/AffineStructures.h"
 #include "mlir/Analysis/Utils.h"
 #include "mlir/Dialect/Affine/IR/AffineOps.h"
-#include "mlir/Dialect/StandardOps/IR/Ops.h"
 #include "mlir/IR/Builders.h"
 #include "mlir/Pass/Pass.h"
 #include "llvm/Support/Debug.h"

diff  --git a/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp b/mlir/test/lib/Analysis/TestMemRefStrideCalculation.cpp
similarity index 96%
rename from mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
rename to mlir/test/lib/Analysis/TestMemRefStrideCalculation.cpp
index 8b5c507b3794d..cfa47b9f7d083 100644
--- a/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
+++ b/mlir/test/lib/Analysis/TestMemRefStrideCalculation.cpp
@@ -7,10 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "mlir/Dialect/MemRef/IR/MemRef.h"
-#include "mlir/Dialect/StandardOps/IR/Ops.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Transforms/Passes.h"
 
 using namespace mlir;
 

diff  --git a/mlir/test/lib/Transforms/TestNumberOfExecutions.cpp b/mlir/test/lib/Analysis/TestNumberOfExecutions.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestNumberOfExecutions.cpp
rename to mlir/test/lib/Analysis/TestNumberOfExecutions.cpp

diff  --git a/mlir/test/lib/CMakeLists.txt b/mlir/test/lib/CMakeLists.txt
index 770b715e1af64..2c1eb8891b0b0 100644
--- a/mlir/test/lib/CMakeLists.txt
+++ b/mlir/test/lib/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_subdirectory(Analysis)
+add_subdirectory(Conversion)
 add_subdirectory(Dialect)
 add_subdirectory(IR)
 add_subdirectory(Pass)

diff  --git a/mlir/test/lib/Conversion/CMakeLists.txt b/mlir/test/lib/Conversion/CMakeLists.txt
new file mode 100644
index 0000000000000..d645b5a18aba6
--- /dev/null
+++ b/mlir/test/lib/Conversion/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(StandardToLLVM)

diff  --git a/mlir/test/lib/Conversion/StandardToLLVM/CMakeLists.txt b/mlir/test/lib/Conversion/StandardToLLVM/CMakeLists.txt
new file mode 100644
index 0000000000000..d5bedb0120cca
--- /dev/null
+++ b/mlir/test/lib/Conversion/StandardToLLVM/CMakeLists.txt
@@ -0,0 +1,16 @@
+# Exclude tests from libMLIR.so
+add_mlir_library(MLIRTestStandardToLLVM
+  TestConvertCallOp.cpp
+
+  EXCLUDE_FROM_LIBMLIR
+
+  LINK_LIBS PUBLIC
+  MLIRLLVMIR
+  MLIRLLVMIRTransforms
+  MLIRPass
+  MLIRStandardToLLVM
+  MLIRTestDialect
+  )
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../Dialect/Test)
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../Dialect/Test)

diff  --git a/mlir/test/lib/Transforms/TestConvertCallOp.cpp b/mlir/test/lib/Conversion/StandardToLLVM/TestConvertCallOp.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestConvertCallOp.cpp
rename to mlir/test/lib/Conversion/StandardToLLVM/TestConvertCallOp.cpp

diff  --git a/mlir/test/lib/Dialect/Affine/CMakeLists.txt b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
index 3d08fed788e2e..bad8e06ef35df 100644
--- a/mlir/test/lib/Dialect/Affine/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
@@ -2,6 +2,7 @@
 add_mlir_library(MLIRAffineTransformsTestPasses
   TestAffineDataCopy.cpp
   TestAffineLoopUnswitching.cpp
+  TestAffineLoopParametricTiling.cpp
   TestLoopPermutation.cpp
   TestVectorizationUtils.cpp
 

diff  --git a/mlir/test/lib/Transforms/TestAffineLoopParametricTiling.cpp b/mlir/test/lib/Dialect/Affine/TestAffineLoopParametricTiling.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestAffineLoopParametricTiling.cpp
rename to mlir/test/lib/Dialect/Affine/TestAffineLoopParametricTiling.cpp

diff  --git a/mlir/test/lib/Dialect/CMakeLists.txt b/mlir/test/lib/Dialect/CMakeLists.txt
index adee9f8a1514b..d8219057f9391 100644
--- a/mlir/test/lib/Dialect/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/CMakeLists.txt
@@ -1,5 +1,12 @@
 add_subdirectory(Affine)
+add_subdirectory(DLTI)
+add_subdirectory(GPU)
+add_subdirectory(Linalg)
+add_subdirectory(Math)
+add_subdirectory(SCF)
 add_subdirectory(Shape)
 add_subdirectory(SPIRV)
+add_subdirectory(StandardOps)
 add_subdirectory(Test)
 add_subdirectory(Tosa)
+add_subdirectory(Vector)

diff  --git a/mlir/test/lib/Dialect/DLTI/CMakeLists.txt b/mlir/test/lib/Dialect/DLTI/CMakeLists.txt
new file mode 100644
index 0000000000000..f9a17f42ab4ed
--- /dev/null
+++ b/mlir/test/lib/Dialect/DLTI/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Exclude tests from libMLIR.so
+add_mlir_library(MLIRDLTITestPasses
+  TestDataLayoutQuery.cpp
+
+  EXCLUDE_FROM_LIBMLIR
+
+  LINK_LIBS PUBLIC
+  MLIRDLTI
+  MLIRPass
+  MLIRTestDialect
+  )
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Test)
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Test)

diff  --git a/mlir/test/lib/Transforms/TestDataLayoutQuery.cpp b/mlir/test/lib/Dialect/DLTI/TestDataLayoutQuery.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestDataLayoutQuery.cpp
rename to mlir/test/lib/Dialect/DLTI/TestDataLayoutQuery.cpp

diff  --git a/mlir/test/lib/Dialect/GPU/CMakeLists.txt b/mlir/test/lib/Dialect/GPU/CMakeLists.txt
new file mode 100644
index 0000000000000..6a79e2f443345
--- /dev/null
+++ b/mlir/test/lib/Dialect/GPU/CMakeLists.txt
@@ -0,0 +1,24 @@
+# Exclude tests from libMLIR.so
+add_mlir_library(MLIRGPUTestPasses
+  TestConvertGPUKernelToCubin.cpp
+  TestConvertGPUKernelToHsaco.cpp
+  TestGpuMemoryPromotion.cpp
+  TestGpuParallelLoopMapping.cpp
+  TestGpuRewrite.cpp
+
+  EXCLUDE_FROM_LIBMLIR
+
+  LINK_LIBS PUBLIC
+  MLIRAffine
+  MLIRGPU
+  MLIRGPUToGPURuntimeTransforms
+  MLIRLLVMToLLVMIRTranslation
+  MLIRNVVMIR
+  MLIRNVVMToLLVMIRTranslation
+  MLIRPass
+  MLIRROCDLIR
+  MLIRROCDLToLLVMIRTranslation
+  MLIRSCF
+  MLIRStandard
+  MLIRTransformUtils
+  )

diff  --git a/mlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp b/mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToCubin.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp
rename to mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToCubin.cpp

diff  --git a/mlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp b/mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToHsaco.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp
rename to mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToHsaco.cpp

diff  --git a/mlir/test/lib/Transforms/TestGpuMemoryPromotion.cpp b/mlir/test/lib/Dialect/GPU/TestGpuMemoryPromotion.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestGpuMemoryPromotion.cpp
rename to mlir/test/lib/Dialect/GPU/TestGpuMemoryPromotion.cpp

diff  --git a/mlir/test/lib/Transforms/TestGpuParallelLoopMapping.cpp b/mlir/test/lib/Dialect/GPU/TestGpuParallelLoopMapping.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestGpuParallelLoopMapping.cpp
rename to mlir/test/lib/Dialect/GPU/TestGpuParallelLoopMapping.cpp

diff  --git a/mlir/test/lib/Transforms/TestGpuRewrite.cpp b/mlir/test/lib/Dialect/GPU/TestGpuRewrite.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestGpuRewrite.cpp
rename to mlir/test/lib/Dialect/GPU/TestGpuRewrite.cpp

diff  --git a/mlir/test/lib/Dialect/Linalg/CMakeLists.txt b/mlir/test/lib/Dialect/Linalg/CMakeLists.txt
new file mode 100644
index 0000000000000..22d78dfaad729
--- /dev/null
+++ b/mlir/test/lib/Dialect/Linalg/CMakeLists.txt
@@ -0,0 +1,23 @@
+# Exclude tests from libMLIR.so
+add_mlir_library(MLIRLinalgTestPasses
+  TestConvVectorization.cpp
+  TestLinalgCodegenStrategy.cpp
+  TestLinalgElementwiseFusion.cpp
+  TestLinalgFusionTransforms.cpp
+  TestLinalgHoisting.cpp
+  TestLinalgTransforms.cpp
+
+  EXCLUDE_FROM_LIBMLIR
+
+  LINK_LIBS PUBLIC
+  MLIRAffine
+  MLIRGPU
+  MLIRLinalg
+  MLIRLinalgTransforms
+  MLIRLLVMToLLVMIRTranslation
+  MLIRPass
+  MLIRStandard
+  MLIRTransformUtils
+  MLIRVector
+  MLIRVectorToSCF
+  )

diff  --git a/mlir/test/lib/Transforms/TestConvVectorization.cpp b/mlir/test/lib/Dialect/Linalg/TestConvVectorization.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestConvVectorization.cpp
rename to mlir/test/lib/Dialect/Linalg/TestConvVectorization.cpp

diff  --git a/mlir/test/lib/Transforms/TestLinalgCodegenStrategy.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestLinalgCodegenStrategy.cpp
rename to mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp

diff  --git a/mlir/test/lib/Transforms/TestLinalgElementwiseFusion.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgElementwiseFusion.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestLinalgElementwiseFusion.cpp
rename to mlir/test/lib/Dialect/Linalg/TestLinalgElementwiseFusion.cpp

diff  --git a/mlir/test/lib/Transforms/TestLinalgFusionTransforms.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestLinalgFusionTransforms.cpp
rename to mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp

diff  --git a/mlir/test/lib/Transforms/TestLinalgHoisting.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgHoisting.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestLinalgHoisting.cpp
rename to mlir/test/lib/Dialect/Linalg/TestLinalgHoisting.cpp

diff  --git a/mlir/test/lib/Transforms/TestLinalgTransforms.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestLinalgTransforms.cpp
rename to mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp

diff  --git a/mlir/test/lib/Dialect/Math/CMakeLists.txt b/mlir/test/lib/Dialect/Math/CMakeLists.txt
new file mode 100644
index 0000000000000..600183145833d
--- /dev/null
+++ b/mlir/test/lib/Dialect/Math/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Exclude tests from libMLIR.so
+add_mlir_library(MLIRMathTestPasses
+  TestExpandTanh.cpp
+  TestPolynomialApproximation.cpp
+
+  EXCLUDE_FROM_LIBMLIR
+
+  LINK_LIBS PUBLIC
+  MLIRMathTransforms
+  MLIRPass
+  MLIRTransformUtils
+  MLIRVector
+  )

diff  --git a/mlir/test/lib/Transforms/TestExpandTanh.cpp b/mlir/test/lib/Dialect/Math/TestExpandTanh.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestExpandTanh.cpp
rename to mlir/test/lib/Dialect/Math/TestExpandTanh.cpp

diff  --git a/mlir/test/lib/Transforms/TestPolynomialApproximation.cpp b/mlir/test/lib/Dialect/Math/TestPolynomialApproximation.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestPolynomialApproximation.cpp
rename to mlir/test/lib/Dialect/Math/TestPolynomialApproximation.cpp

diff  --git a/mlir/test/lib/Dialect/SCF/CMakeLists.txt b/mlir/test/lib/Dialect/SCF/CMakeLists.txt
new file mode 100644
index 0000000000000..31b04b1f3a98a
--- /dev/null
+++ b/mlir/test/lib/Dialect/SCF/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Exclude tests from libMLIR.so
+add_mlir_library(MLIRSCFTestPasses
+  TestSCFUtils.cpp
+
+  EXCLUDE_FROM_LIBMLIR
+
+  LINK_LIBS PUBLIC
+  MLIRPass
+  MLIRSCF
+  MLIRSCFTransforms
+  MLIRTransformUtils
+  )

diff  --git a/mlir/test/lib/Transforms/TestSCFUtils.cpp b/mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestSCFUtils.cpp
rename to mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp

diff  --git a/mlir/test/lib/Dialect/StandardOps/CMakeLists.txt b/mlir/test/lib/Dialect/StandardOps/CMakeLists.txt
new file mode 100644
index 0000000000000..4d4cd107f2116
--- /dev/null
+++ b/mlir/test/lib/Dialect/StandardOps/CMakeLists.txt
@@ -0,0 +1,17 @@
+# Exclude tests from libMLIR.so
+add_mlir_library(MLIRStandardOpsTestPasses
+  TestDecomposeCallGraphTypes.cpp
+  TestComposeSubView.cpp
+
+  EXCLUDE_FROM_LIBMLIR
+
+  LINK_LIBS PUBLIC
+  MLIRAffine
+  MLIRPass
+  MLIRStandardOpsTransforms
+  MLIRTestDialect
+  MLIRTransformUtils
+  )
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Test)
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Test)

diff  --git a/mlir/test/lib/Transforms/TestComposeSubView.cpp b/mlir/test/lib/Dialect/StandardOps/TestComposeSubView.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestComposeSubView.cpp
rename to mlir/test/lib/Dialect/StandardOps/TestComposeSubView.cpp

diff  --git a/mlir/test/lib/Transforms/TestDecomposeCallGraphTypes.cpp b/mlir/test/lib/Dialect/StandardOps/TestDecomposeCallGraphTypes.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestDecomposeCallGraphTypes.cpp
rename to mlir/test/lib/Dialect/StandardOps/TestDecomposeCallGraphTypes.cpp

diff  --git a/mlir/test/lib/Dialect/Vector/CMakeLists.txt b/mlir/test/lib/Dialect/Vector/CMakeLists.txt
new file mode 100644
index 0000000000000..c6ddfb5ec4b91
--- /dev/null
+++ b/mlir/test/lib/Dialect/Vector/CMakeLists.txt
@@ -0,0 +1,18 @@
+# Exclude tests from libMLIR.so
+add_mlir_library(MLIRVectorTestPasses
+  TestVectorTransforms.cpp
+
+  EXCLUDE_FROM_LIBMLIR
+
+  LINK_LIBS PUBLIC
+  MLIRAffine
+  MLIRAnalysis
+  MLIRLinalg
+  MLIRMemRef
+  MLIRPass
+  MLIRSCF
+  MLIRStandard
+  MLIRTransformUtils
+  MLIRVector
+  MLIRVectorToSCF
+  )

diff  --git a/mlir/test/lib/Transforms/TestVectorTransforms.cpp b/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestVectorTransforms.cpp
rename to mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp

diff  --git a/mlir/test/lib/IR/CMakeLists.txt b/mlir/test/lib/IR/CMakeLists.txt
index 337029e0dac84..fc47158548ba4 100644
--- a/mlir/test/lib/IR/CMakeLists.txt
+++ b/mlir/test/lib/IR/CMakeLists.txt
@@ -1,8 +1,10 @@
 # Exclude tests from libMLIR.so
 add_mlir_library(MLIRTestIR
+  TestDominance.cpp
   TestFunc.cpp
   TestInterfaces.cpp
   TestMatchers.cpp
+  TestOpaqueLoc.cpp
   TestPrintDefUse.cpp
   TestPrintNesting.cpp
   TestSideEffects.cpp

diff  --git a/mlir/test/lib/Transforms/TestDominance.cpp b/mlir/test/lib/IR/TestDominance.cpp
similarity index 100%
rename from mlir/test/lib/Transforms/TestDominance.cpp
rename to mlir/test/lib/IR/TestDominance.cpp

diff  --git a/mlir/test/lib/Transforms/TestOpaqueLoc.cpp b/mlir/test/lib/IR/TestOpaqueLoc.cpp
similarity index 98%
rename from mlir/test/lib/Transforms/TestOpaqueLoc.cpp
rename to mlir/test/lib/IR/TestOpaqueLoc.cpp
index 817e1527d76b5..8b161313b4311 100644
--- a/mlir/test/lib/Transforms/TestOpaqueLoc.cpp
+++ b/mlir/test/lib/IR/TestOpaqueLoc.cpp
@@ -6,7 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "mlir/Dialect/StandardOps/IR/Ops.h"
 #include "mlir/IR/Builders.h"
 #include "mlir/Pass/Pass.h"
 

diff  --git a/mlir/test/lib/Pass/CMakeLists.txt b/mlir/test/lib/Pass/CMakeLists.txt
index 608141e349d10..061d40fc978f8 100644
--- a/mlir/test/lib/Pass/CMakeLists.txt
+++ b/mlir/test/lib/Pass/CMakeLists.txt
@@ -1,5 +1,6 @@
 # Exclude tests from libMLIR.so
 add_mlir_library(MLIRTestPass
+  TestDynamicPipeline.cpp
   TestPassManager.cpp
 
   EXCLUDE_FROM_LIBMLIR

diff  --git a/mlir/test/lib/Transforms/TestDynamicPipeline.cpp b/mlir/test/lib/Pass/TestDynamicPipeline.cpp
similarity index 96%
rename from mlir/test/lib/Transforms/TestDynamicPipeline.cpp
rename to mlir/test/lib/Pass/TestDynamicPipeline.cpp
index 98e30b9a6d231..73b299e48ef10 100644
--- a/mlir/test/lib/Transforms/TestDynamicPipeline.cpp
+++ b/mlir/test/lib/Pass/TestDynamicPipeline.cpp
@@ -10,12 +10,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "mlir/Dialect/SCF/SCF.h"
-#include "mlir/IR/Builders.h"
 #include "mlir/Pass/Pass.h"
 #include "mlir/Pass/PassManager.h"
-#include "mlir/Transforms/LoopUtils.h"
-#include "mlir/Transforms/Passes.h"
 
 using namespace mlir;
 

diff  --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt
index 3ce4fd0e258b8..8dc5b79897a01 100644
--- a/mlir/test/lib/Transforms/CMakeLists.txt
+++ b/mlir/test/lib/Transforms/CMakeLists.txt
@@ -1,75 +1,19 @@
 # Exclude tests from libMLIR.so
 add_mlir_library(MLIRTestTransforms
-  TestAffineLoopParametricTiling.cpp
-  TestExpandTanh.cpp
-  TestCallGraph.cpp
-  TestDecomposeCallGraphTypes.cpp
   TestConstantFold.cpp
-  TestConvVectorization.cpp
-  TestConvertCallOp.cpp
-  TestConvertGPUKernelToCubin.cpp
-  TestConvertGPUKernelToHsaco.cpp
-  TestDataLayoutQuery.cpp
-  TestDominance.cpp
-  TestDynamicPipeline.cpp
-  TestComposeSubView.cpp
-  TestLoopFusion.cpp
-  TestGpuMemoryPromotion.cpp
-  TestGpuParallelLoopMapping.cpp
-  TestGpuRewrite.cpp
   TestInlining.cpp
-  TestLinalgCodegenStrategy.cpp
-  TestLinalgElementwiseFusion.cpp
-  TestLinalgFusionTransforms.cpp
-  TestLinalgHoisting.cpp
-  TestLinalgTransforms.cpp
-  TestLiveness.cpp
+  TestLoopFusion.cpp
   TestLoopMapping.cpp
   TestLoopParametricTiling.cpp
   TestLoopUnrolling.cpp
-  TestNumberOfExecutions.cpp
-  TestOpaqueLoc.cpp
-  TestPolynomialApproximation.cpp
-  TestMemRefBoundCheck.cpp
-  TestMemRefDependenceCheck.cpp
-  TestMemRefStrideCalculation.cpp
-  TestSCFUtils.cpp
-  TestVectorTransforms.cpp
 
   EXCLUDE_FROM_LIBMLIR
 
   ADDITIONAL_HEADER_DIRS
   ${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms
 
-  DEPENDS
-  MLIRStandardOpsIncGen
-
   LINK_LIBS PUBLIC
-  MLIRAffine
-  MLIRAnalysis
-  MLIREDSC
-  MLIRGPU
-  MLIRGPU
-  MLIRGPUToGPURuntimeTransforms
-  MLIRLinalg
-  MLIRLinalgTransforms
-  MLIRLLVMToLLVMIRTranslation
-  MLIRMathTransforms
-  MLIRNVVMIR
-  MLIRNVVMToLLVMIRTranslation
-  MLIRPass
-  MLIRROCDLIR
-  MLIRROCDLToLLVMIRTranslation
-  MLIRSCF
-  MLIRSCFTransforms
-  MLIRStandardOpsTransforms
-  MLIRSparseTensor
-  MLIRSparseTensorTransforms
-  MLIRTargetLLVMIRExport
-  MLIRTestDialect
-  MLIRTransformUtils
-  MLIRVector
-  MLIRVectorToSCF
+  MLIRTransforms
   )
 
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test)

diff  --git a/mlir/test/lib/Transforms/TestConstantFold.cpp b/mlir/test/lib/Transforms/TestConstantFold.cpp
index 08cf65ad69cb7..e7cd9f0880e5f 100644
--- a/mlir/test/lib/Transforms/TestConstantFold.cpp
+++ b/mlir/test/lib/Transforms/TestConstantFold.cpp
@@ -6,10 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "mlir/Dialect/Affine/IR/AffineOps.h"
-#include "mlir/Dialect/StandardOps/IR/Ops.h"
-#include "mlir/IR/Builders.h"
-#include "mlir/IR/BuiltinOps.h"
 #include "mlir/Pass/Pass.h"
 #include "mlir/Transforms/FoldUtils.h"
 #include "mlir/Transforms/Passes.h"

diff  --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt
index 5131d1e885ad1..3c3e174e8ba4a 100644
--- a/mlir/tools/mlir-opt/CMakeLists.txt
+++ b/mlir/tools/mlir-opt/CMakeLists.txt
@@ -12,9 +12,17 @@ set(LLVM_LINK_COMPONENTS
 
 if(MLIR_INCLUDE_TESTS)
   set(test_libs
+    MLIRTestStandardToLLVM
     MLIRAffineTransformsTestPasses
+    MLIRDLTITestPasses
+    MLIRGPUTestPasses
+    MLIRLinalgTestPasses
+    MLIRMathTestPasses
+    MLIRSCFTestPasses
     MLIRShapeTestPasses
     MLIRSPIRVTestPasses
+    MLIRStandardOpsTestPasses
+    MLIRVectorTestPasses
     MLIRTestAnalysis
     MLIRTestDialect
     MLIRTestIR


        


More information about the Mlir-commits mailing list