Split test-specific passes out of mlir-opt

Instead put their impl in test/lib and link them into mlir-test-opt

PiperOrigin-RevId: 254837439
This commit is contained in:
Nicolas Vasilache 2019-06-24 14:35:21 -07:00 committed by jpienaar
parent 6192978bc0
commit dac75ae5ff
24 changed files with 33 additions and 34 deletions

View File

@ -16,8 +16,6 @@ add_llvm_library(MLIRTransforms
PipelineDataTransfer.cpp
SimplifyAffineStructures.cpp
StripDebugInfo.cpp
TestConstantFold.cpp
TestLoopFusion.cpp
Utils/FoldUtils.cpp
Utils/GreedyPatternRewriteDriver.cpp
Utils/LoopFusionUtils.cpp
@ -26,7 +24,6 @@ add_llvm_library(MLIRTransforms
Utils/Utils.cpp
Vectorization
Vectorize.cpp
Vectorization/VectorizerTestPass.cpp
ViewFunctionGraph.cpp
ADDITIONAL_HEADER_DIRS

View File

@ -1,7 +1,7 @@
add_subdirectory(EDSC)
add_subdirectory(mlir-cpu-runner)
add_subdirectory(SDBM)
add_subdirectory(TestDialect)
add_subdirectory(lib)
llvm_canonicalize_cmake_booleans(
LLVM_BUILD_EXAMPLES
@ -32,7 +32,6 @@ set(MLIR_TEST_DEPENDS
mlir-opt
mlir-sdbm-api-test
mlir-tblgen
mlir-test-opt
mlir-translate
cblas
cblas_interface

View File

@ -1,4 +1,4 @@
// RUN: mlir-test-opt %s -split-input-file -verify-diagnostics | FileCheck %s
// RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s
//===----------------------------------------------------------------------===//
// Test TypeArrayAttr

View File

@ -1,4 +1,4 @@
// RUN: mlir-test-opt %s -split-input-file -verify-diagnostics | FileCheck %s
// RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s
//===----------------------------------------------------------------------===//
// Test mixed normal and variadic operands

View File

@ -1,4 +1,4 @@
// RUN: mlir-test-opt %s -split-input-file -verify-diagnostics | FileCheck %s
// RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s
//===----------------------------------------------------------------------===//
// Test the number of regions

View File

@ -1,4 +1,4 @@
// RUN: mlir-test-opt %s -split-input-file -verify-diagnostics | FileCheck %s
// RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s
//===----------------------------------------------------------------------===//
// Test mixed normal and variadic results

View File

@ -1,4 +1,4 @@
// RUN: mlir-test-opt %s -split-input-file -verify-diagnostics | FileCheck %s
// RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s
// CHECK: succeededSameOperandAndResultElementType
func @succeededSameOperandAndResultElementType(%t10x10 : tensor<10x10xf32>, %t1: tensor<1xf32>, %v1: vector<1xf32>, %t1i: tensor<1xi32>) {

View File

@ -1,4 +1,4 @@
// RUN: mlir-test-opt -test-legalize-patterns -split-input-file -verify-diagnostics %s | FileCheck %s --dump-input=fail
// RUN: mlir-opt -test-legalize-patterns -split-input-file -verify-diagnostics %s | FileCheck %s --dump-input=fail
// CHECK-LABEL: verifyDirectPattern
func @verifyDirectPattern() -> i32 {

View File

@ -0,0 +1,2 @@
add_subdirectory(TestDialect)
add_subdirectory(Transforms)

View File

@ -15,25 +15,10 @@ add_llvm_library(MLIRTestDialect
)
add_dependencies(MLIRTestDialect
MLIRTestOpsIncGen
LLVMSupport
)
target_link_libraries(MLIRTestDialect
LLVMSupport
)
add_llvm_executable(mlir-test-opt
${MLIR_MAIN_SRC_DIR}/../tools/mlir-opt/mlir-opt.cpp
TestDialect.cpp
TestPatterns.cpp
)
llvm_update_compile_flags(mlir-test-opt)
whole_archive_link(mlir-test-opt
MLIRStandardOps
)
target_link_libraries(mlir-test-opt
PRIVATE
MLIRMlirOptLib
MLIROptMain
MLIRTypeUtilities
LLVMSupport
)
target_link_libraries(MLIRTestDialect
MLIRTypeUtilities
LLVMSupport
)

View File

@ -0,0 +1,15 @@
add_llvm_library(MLIRTestTransforms
TestConstantFold.cpp
TestLoopFusion.cpp
TestVectorizationUtils.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms
)
add_dependencies(MLIRTestTransforms MLIRStandardOpsIncGen)
target_link_libraries(MLIRTestTransforms
MLIRAffineOps
MLIRAnalysis
MLIRPass
MLIRVectorOps
)

View File

@ -55,7 +55,6 @@ tool_dirs = [config.mlir_tools_dir, config.llvm_tools_dir]
tools = [
'mlir-opt',
'mlir-tblgen',
'mlir-test-opt',
'mlir-translate',
'mlir-edsc-builder-api-test',
]

View File

@ -1,4 +1,4 @@
// RUN: mlir-test-opt -test-patterns -mlir-print-debuginfo %s | FileCheck %s
// RUN: mlir-opt -test-patterns -mlir-print-debuginfo %s | FileCheck %s
// CHECK-LABEL: verifyConstantAttr
func @verifyConstantAttr(%arg0 : i32) -> i32 {

View File

@ -1,4 +1,4 @@
// RUN: mlir-test-opt %s -split-input-file -verify-diagnostics | FileCheck %s
// RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s
// -----

View File

@ -1,4 +1,4 @@
// RUN: mlir-test-opt -test-patterns %s | FileCheck %s
// RUN: mlir-opt -test-patterns %s | FileCheck %s
//===----------------------------------------------------------------------===//
// Test 'verifyUnusedValue'

View File

@ -35,6 +35,8 @@ set(LIBS
MLIRStandardOps
MLIRStandardToLLVM
MLIRTransforms
MLIRTestDialect
MLIRTestTransforms
MLIRSupport
MLIRVectorOps
)