diff options
| author | Nicolas Vasilache <ntv@google.com> | 2019-12-10 11:54:00 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-10 11:54:33 -0800 |
| commit | ad38e4980642a2d9b0add2923454212eac3cd94f (patch) | |
| tree | 0519d40ccd7d10f52b204f4f3bfbbe53024145bc /mlir/test/lib/Transforms | |
| parent | 8ccb350979f8fe1f3a80867882bfb1d93fd7dc48 (diff) | |
| download | bcm5719-llvm-ad38e4980642a2d9b0add2923454212eac3cd94f.tar.gz bcm5719-llvm-ad38e4980642a2d9b0add2923454212eac3cd94f.zip | |
Uniformize Vector transforms as patterns on the model of Linalg - NFC
This reorganizes the vector transformations to be more easily testable as patterns and more easily composable into fused passes in the future.
PiperOrigin-RevId: 284817474
Diffstat (limited to 'mlir/test/lib/Transforms')
| -rw-r--r-- | mlir/test/lib/Transforms/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | mlir/test/lib/Transforms/TestVectorTransforms.cpp (renamed from mlir/test/lib/Transforms/TestVectorToVectorConversion.cpp) | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt index 8a7933451b8..11d27483dc6 100644 --- a/mlir/test/lib/Transforms/CMakeLists.txt +++ b/mlir/test/lib/Transforms/CMakeLists.txt @@ -10,7 +10,7 @@ add_llvm_library(MLIRTestTransforms TestOpaqueLoc.cpp TestMemRefStrideCalculation.cpp TestVectorToLoopsConversion.cpp - TestVectorToVectorConversion.cpp + TestVectorTransforms.cpp TestVectorizationUtils.cpp ADDITIONAL_HEADER_DIRS @@ -23,6 +23,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/../DeclarativeTransforms) add_dependencies(MLIRTestTransforms MLIRStandardOpsIncGen) add_dependencies(MLIRTestTransforms MLIRTestLinalgTransformPatternsIncGen) add_dependencies(MLIRTestTransforms MLIRTestLinalgTilePermutePatternsIncGen) +add_dependencies(MLIRTestTransforms MLIRTestVectorTransformPatternsIncGen) target_link_libraries(MLIRTestTransforms MLIRAffineOps MLIRAnalysis diff --git a/mlir/test/lib/Transforms/TestVectorToVectorConversion.cpp b/mlir/test/lib/Transforms/TestVectorTransforms.cpp index 9f9b8a554fe..909fe2afba6 100644 --- a/mlir/test/lib/Transforms/TestVectorToVectorConversion.cpp +++ b/mlir/test/lib/Transforms/TestVectorTransforms.cpp @@ -1,5 +1,4 @@ -//===- TestVectorToVectorConversion.cpp - Test VectorTransfers lowering -//-------===// +//===- TestVectorToVectorConversion.cpp - Test VectorTransfers lowering ---===// // // Copyright 2019 The MLIR Authors. // @@ -18,25 +17,28 @@ #include <type_traits> +#include "mlir/Dialect/StandardOps/Ops.h" +#include "mlir/Dialect/VectorOps/VectorOps.h" #include "mlir/Dialect/VectorOps/VectorTransforms.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" -#include "mlir/Transforms/Passes.h" using namespace mlir; +using namespace mlir::vector; namespace { +#include "TestVectorTransformPatterns.h.inc" struct TestVectorToVectorConversion : public FunctionPass<TestVectorToVectorConversion> { void runOnFunction() override { OwningRewritePatternList patterns; auto *context = &getContext(); - populateVectorToVectorConversionPatterns(context, patterns); + populateWithGenerated(context, &patterns); + populateVectorToVectorCanonicalizationPatterns(patterns, context); applyPatternsGreedily(getFunction(), patterns); } }; - } // end anonymous namespace static PassRegistration<TestVectorToVectorConversion> |

