[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
This commit is contained in:
River Riddle 2021-05-14 10:27:57 -07:00
parent 1dbfeb463b
commit 3fef2d26a3
47 changed files with 169 additions and 77 deletions

View File

@ -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
LINK_LIBS PUBLIC
MLIRAffine
MLIRAnalysis
MLIRMemRef
MLIRPass
MLIRTestDialect
)

View File

@ -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"

View File

@ -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"

View File

@ -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;

View File

@ -1,4 +1,5 @@
add_subdirectory(Analysis)
add_subdirectory(Conversion)
add_subdirectory(Dialect)
add_subdirectory(IR)
add_subdirectory(Pass)

View File

@ -0,0 +1 @@
add_subdirectory(StandardToLLVM)

View File

@ -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)

View File

@ -2,6 +2,7 @@
add_mlir_library(MLIRAffineTransformsTestPasses
TestAffineDataCopy.cpp
TestAffineLoopUnswitching.cpp
TestAffineLoopParametricTiling.cpp
TestLoopPermutation.cpp
TestVectorizationUtils.cpp

View File

@ -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)

View File

@ -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)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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)

View File

@ -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
)

View File

@ -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

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/Builders.h"
#include "mlir/Pass/Pass.h"

View File

@ -1,5 +1,6 @@
# Exclude tests from libMLIR.so
add_mlir_library(MLIRTestPass
TestDynamicPipeline.cpp
TestPassManager.cpp
EXCLUDE_FROM_LIBMLIR

View File

@ -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;

View File

@ -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)

View File

@ -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"

View File

@ -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