summaryrefslogtreecommitdiffstats
path: root/mlir/test/lib/Transforms
diff options
context:
space:
mode:
authorNicolas Vasilache <ntv@google.com>2019-11-14 15:39:36 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-11-14 15:40:07 -0800
commit0b271b7dfe285064b8b237d18bfc923212e7a77b (patch)
tree3783613205ec9f87106a6fa7f730e22f97d91745 /mlir/test/lib/Transforms
parenta78bd84cf84c00914f48781fa0c561cbb6bdf847 (diff)
downloadbcm5719-llvm-0b271b7dfe285064b8b237d18bfc923212e7a77b.tar.gz
bcm5719-llvm-0b271b7dfe285064b8b237d18bfc923212e7a77b.zip
Refactor the LowerVectorTransfers pass to use the RewritePattern infra - NFC
This is step 1/n in refactoring infrastructure along the Vector dialect to make it ready for retargetability and composable progressive lowering. PiperOrigin-RevId: 280529784
Diffstat (limited to 'mlir/test/lib/Transforms')
-rw-r--r--mlir/test/lib/Transforms/CMakeLists.txt1
-rw-r--r--mlir/test/lib/Transforms/TestLowerVectorTransfers.cpp44
2 files changed, 45 insertions, 0 deletions
diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt
index 8669dfed1d7..675b695aa7c 100644
--- a/mlir/test/lib/Transforms/CMakeLists.txt
+++ b/mlir/test/lib/Transforms/CMakeLists.txt
@@ -5,6 +5,7 @@ add_llvm_library(MLIRTestTransforms
TestInlining.cpp
TestLoopMapping.cpp
TestLoopParametricTiling.cpp
+ TestLowerVectorTransfers.cpp
TestOpaqueLoc.cpp
TestMemRefStrideCalculation.cpp
TestVectorizationUtils.cpp
diff --git a/mlir/test/lib/Transforms/TestLowerVectorTransfers.cpp b/mlir/test/lib/Transforms/TestLowerVectorTransfers.cpp
new file mode 100644
index 00000000000..8341777f6a4
--- /dev/null
+++ b/mlir/test/lib/Transforms/TestLowerVectorTransfers.cpp
@@ -0,0 +1,44 @@
+//===- TestLowerVectorTransfers.cpp - Test VectorTransfers lowering -------===//
+//
+// Copyright 2019 The MLIR Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// =============================================================================
+
+#include <type_traits>
+
+#include "mlir/Conversion/VectorConversions/VectorConversions.h"
+#include "mlir/IR/PatternMatch.h"
+#include "mlir/Pass/Pass.h"
+#include "mlir/Transforms/Passes.h"
+
+using namespace mlir;
+
+namespace {
+
+struct TestLowerVectorTransfersPass
+ : public FunctionPass<TestLowerVectorTransfersPass> {
+ void runOnFunction() override {
+ OwningRewritePatternList patterns;
+ auto *context = &getContext();
+ populateVectorToAffineLoopsConversionPatterns(context, patterns);
+ applyPatternsGreedily(getFunction(), patterns);
+ }
+};
+
+} // end anonymous namespace
+
+static PassRegistration<TestLowerVectorTransfersPass>
+ pass("test-affine-lower-vector-transfers",
+ "Materializes vector transfer ops to a "
+ "proper abstraction for the hardware");
OpenPOWER on IntegriCloud