[Mlir-commits] [mlir] b873761 - [MLIR][NFC] Move some of the affine transforms / tests to dialect dirs
Uday Bondhugula
llvmlistbot at llvm.org
Sun Mar 22 19:55:48 PDT 2020
Author: Uday Bondhugula
Date: 2020-03-23T08:25:07+05:30
New Revision: b8737614964085dc19619ed90eb4f3b58350a2c9
URL: https://github.com/llvm/llvm-project/commit/b8737614964085dc19619ed90eb4f3b58350a2c9
DIFF: https://github.com/llvm/llvm-project/commit/b8737614964085dc19619ed90eb4f3b58350a2c9.diff
LOG: [MLIR][NFC] Move some of the affine transforms / tests to dialect dirs
Move some of the affine transforms and their test cases to their
respective dialect directory. This patch does not complete the move, but
takes care of a good part.
Renames: prefix 'affine' to affine loop tiling cl options,
vectorize -> super-vectorize
Signed-off-by: Uday Bondhugula <uday at polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D76565
Added:
mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp
mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp
mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp
mlir/test/Dialect/Affine/SuperVectorize/compose_maps.mlir
mlir/test/Dialect/Affine/SuperVectorize/normalize_maps.mlir
mlir/test/Dialect/Affine/SuperVectorize/vector_utils.mlir
mlir/test/Dialect/Affine/SuperVectorize/vectorize_1d.mlir
mlir/test/Dialect/Affine/SuperVectorize/vectorize_2d.mlir
mlir/test/Dialect/Affine/SuperVectorize/vectorize_3d.mlir
mlir/test/Dialect/Affine/SuperVectorize/vectorize_outer_loop_2d.mlir
mlir/test/Dialect/Affine/SuperVectorize/vectorize_outer_loop_transpose_2d.mlir
mlir/test/Dialect/Affine/SuperVectorize/vectorize_transpose_2d.mlir
mlir/test/Dialect/Affine/affine-data-copy.mlir
mlir/test/Dialect/Affine/affine-loop-invariant-code-motion.mlir
mlir/test/Dialect/Affine/dma-generate.mlir
mlir/test/Dialect/Affine/loop-tiling.mlir
mlir/test/Dialect/Affine/parallelism-detection.mlir
mlir/test/Dialect/Affine/simplify-affine-structures.mlir
mlir/test/Dialect/Affine/slicing-utils.mlir
mlir/test/Dialect/Affine/unroll-jam.mlir
mlir/test/Dialect/Affine/unroll.mlir
mlir/test/lib/Dialect/Affine/TestParallelismDetection.cpp
mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
Modified:
mlir/include/mlir/Dialect/Affine/Passes.h
mlir/include/mlir/InitAllPasses.h
mlir/include/mlir/Transforms/Passes.h
mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
mlir/lib/Transforms/CMakeLists.txt
mlir/test/lib/Dialect/Affine/CMakeLists.txt
mlir/test/lib/Transforms/CMakeLists.txt
Removed:
mlir/lib/Transforms/LoopTiling.cpp
mlir/lib/Transforms/LoopUnroll.cpp
mlir/lib/Transforms/LoopUnrollAndJam.cpp
mlir/lib/Transforms/Vectorize.cpp
mlir/test/Transforms/Vectorize/compose_maps.mlir
mlir/test/Transforms/Vectorize/normalize_maps.mlir
mlir/test/Transforms/Vectorize/vector_utils.mlir
mlir/test/Transforms/Vectorize/vectorize_1d.mlir
mlir/test/Transforms/Vectorize/vectorize_2d.mlir
mlir/test/Transforms/Vectorize/vectorize_3d.mlir
mlir/test/Transforms/Vectorize/vectorize_outer_loop_2d.mlir
mlir/test/Transforms/Vectorize/vectorize_outer_loop_transpose_2d.mlir
mlir/test/Transforms/Vectorize/vectorize_transpose_2d.mlir
mlir/test/Transforms/affine-data-copy.mlir
mlir/test/Transforms/affine-loop-invariant-code-motion.mlir
mlir/test/Transforms/dma-generate.mlir
mlir/test/Transforms/loop-tiling.mlir
mlir/test/Transforms/parallelism-detection.mlir
mlir/test/Transforms/simplify-affine-structures.mlir
mlir/test/Transforms/slicing-utils.mlir
mlir/test/Transforms/unroll-jam.mlir
mlir/test/Transforms/unroll.mlir
mlir/test/lib/Transforms/TestParallelismDetection.cpp
mlir/test/lib/Transforms/TestVectorizationUtils.cpp
################################################################################
diff --git a/mlir/include/mlir/Dialect/Affine/Passes.h b/mlir/include/mlir/Dialect/Affine/Passes.h
index 343a0a60f118..735c6c0360f5 100644
--- a/mlir/include/mlir/Dialect/Affine/Passes.h
+++ b/mlir/include/mlir/Dialect/Affine/Passes.h
@@ -32,7 +32,7 @@ template <typename T> class OpPassBase;
std::unique_ptr<OpPassBase<FuncOp>> createSimplifyAffineStructuresPass();
/// Creates a loop invariant code motion pass that hoists loop invariant
-/// instructions out of affine loop.
+/// operations out of affine loops.
std::unique_ptr<OpPassBase<FuncOp>> createAffineLoopInvariantCodeMotionPass();
/// Performs packing (or explicit copying) of accessed memref regions into
@@ -43,6 +43,31 @@ std::unique_ptr<OpPassBase<FuncOp>> createAffineDataCopyGenerationPass(
unsigned tagMemorySpace = 0, int minDmaTransferSize = 1024,
uint64_t fastMemCapacityBytes = std::numeric_limits<uint64_t>::max());
+/// Creates a pass to perform tiling on loop nests.
+std::unique_ptr<OpPassBase<FuncOp>>
+createLoopTilingPass(uint64_t cacheSizeBytes);
+
+/// Creates a loop unrolling pass with the provided parameters.
+/// 'getUnrollFactor' is a function callback for clients to supply a function
+/// that computes an unroll factor - the callback takes precedence over unroll
+/// factors supplied through other means. If -1 is passed as the unrollFactor
+/// and no callback is provided, anything passed from the command-line (if at
+/// all) or the default unroll factor is used (LoopUnroll:kDefaultUnrollFactor).
+std::unique_ptr<OpPassBase<FuncOp>> createLoopUnrollPass(
+ int unrollFactor = -1, int unrollFull = -1,
+ const std::function<unsigned(AffineForOp)> &getUnrollFactor = nullptr);
+
+/// Creates a loop unroll jam pass to unroll jam by the specified factor. A
+/// factor of -1 lets the pass use the default factor or the one on the command
+/// line if provided.
+std::unique_ptr<OpPassBase<FuncOp>>
+createLoopUnrollAndJamPass(int unrollJamFactor = -1);
+
+/// Creates a pass to vectorize loops, operations and data types using a
+/// target-independent, n-D super-vector abstraction.
+std::unique_ptr<OpPassBase<FuncOp>>
+createSuperVectorizePass(ArrayRef<int64_t> virtualVectorSize);
+
} // end namespace mlir
#endif // MLIR_DIALECT_AFFINE_RANSFORMS_PASSES_H
diff --git a/mlir/include/mlir/InitAllPasses.h b/mlir/include/mlir/InitAllPasses.h
index 2de889841849..b983ecb478dd 100644
--- a/mlir/include/mlir/InitAllPasses.h
+++ b/mlir/include/mlir/InitAllPasses.h
@@ -61,7 +61,7 @@ inline void registerAllPasses() {
// Init general passes
createCanonicalizerPass();
createCSEPass();
- createVectorizePass({});
+ createSuperVectorizePass({});
createLoopUnrollPass();
createLoopUnrollAndJamPass();
createSimplifyAffineStructuresPass();
diff --git a/mlir/include/mlir/Transforms/Passes.h b/mlir/include/mlir/Transforms/Passes.h
index 8515bfd173ea..28b29eb29ad4 100644
--- a/mlir/include/mlir/Transforms/Passes.h
+++ b/mlir/include/mlir/Transforms/Passes.h
@@ -32,27 +32,6 @@ std::unique_ptr<Pass> createCanonicalizerPass();
/// Creates a pass to perform common sub expression elimination.
std::unique_ptr<Pass> createCSEPass();
-/// Creates a pass to vectorize loops, operations and data types using a
-/// target-independent, n-D super-vector abstraction.
-std::unique_ptr<OpPassBase<FuncOp>>
-createVectorizePass(ArrayRef<int64_t> virtualVectorSize);
-
-/// Creates a loop unrolling pass with the provided parameters.
-/// 'getUnrollFactor' is a function callback for clients to supply a function
-/// that computes an unroll factor - the callback takes precedence over unroll
-/// factors supplied through other means. If -1 is passed as the unrollFactor
-/// and no callback is provided, anything passed from the command-line (if at
-/// all) or the default unroll factor is used (LoopUnroll:kDefaultUnrollFactor).
-std::unique_ptr<OpPassBase<FuncOp>> createLoopUnrollPass(
- int unrollFactor = -1, int unrollFull = -1,
- const std::function<unsigned(AffineForOp)> &getUnrollFactor = nullptr);
-
-/// Creates a loop unroll jam pass to unroll jam by the specified factor. A
-/// factor of -1 lets the pass use the default factor or the one on the command
-/// line if provided.
-std::unique_ptr<OpPassBase<FuncOp>>
-createLoopUnrollAndJamPass(int unrollJamFactor = -1);
-
/// Creates a loop fusion pass which fuses loops. Buffers of size less than or
/// equal to `localBufSizeThreshold` are promoted to memory space
/// `fastMemorySpace'.
@@ -65,10 +44,6 @@ createLoopFusionPass(unsigned fastMemorySpace = 0,
/// instructions out of the loop.
std::unique_ptr<Pass> createLoopInvariantCodeMotionPass();
-/// Creates a loop invariant code motion pass that hoists loop invariant
-/// instructions out of affine loop.
-std::unique_ptr<OpPassBase<FuncOp>> createAffineLoopInvariantCodeMotionPass();
-
/// Creates a pass to pipeline explicit movement of data across levels of the
/// memory hierarchy.
std::unique_ptr<OpPassBase<FuncOp>> createPipelineDataTransferPass();
@@ -78,10 +53,6 @@ std::unique_ptr<OpPassBase<FuncOp>> createPipelineDataTransferPass();
/// primitives).
std::unique_ptr<OpPassBase<FuncOp>> createLowerAffinePass();
-/// Creates a pass to perform tiling on loop nests.
-std::unique_ptr<OpPassBase<FuncOp>>
-createLoopTilingPass(uint64_t cacheSizeBytes);
-
/// Creates a pass that transforms perfectly nested loops with independent
/// bounds into a single loop.
std::unique_ptr<OpPassBase<FuncOp>> createLoopCoalescingPass();
diff --git a/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp b/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
index 1616b87c4cdc..746aceb8090a 100644
--- a/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
@@ -16,12 +16,12 @@
#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Analysis/Utils.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
+#include "mlir/Dialect/Affine/Passes.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/Builders.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/LoopUtils.h"
-#include "mlir/Transforms/Passes.h"
#include "mlir/Transforms/Utils.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
diff --git a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
index d7e42b5489fa..9cdc4b92fcd5 100644
--- a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
@@ -1,6 +1,10 @@
add_mlir_dialect_library(MLIRAffineTransforms
AffineDataCopyGeneration.cpp
AffineLoopInvariantCodeMotion.cpp
+ LoopTiling.cpp
+ LoopUnroll.cpp
+ LoopUnrollAndJam.cpp
+ SuperVectorize.cpp
SimplifyAffineStructures.cpp
ADDITIONAL_HEADER_DIRS
diff --git a/mlir/lib/Transforms/LoopTiling.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
similarity index 98%
rename from mlir/lib/Transforms/LoopTiling.cpp
rename to mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
index 49bcc5897c48..de818d7e8bea 100644
--- a/mlir/lib/Transforms/LoopTiling.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
@@ -15,10 +15,10 @@
#include "mlir/Analysis/LoopAnalysis.h"
#include "mlir/Analysis/Utils.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
+#include "mlir/Dialect/Affine/Passes.h"
#include "mlir/IR/Builders.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/LoopUtils.h"
-#include "mlir/Transforms/Passes.h"
#include "mlir/Transforms/Utils.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
@@ -29,19 +29,20 @@ using namespace mlir;
static llvm::cl::OptionCategory clOptionsCategory(DEBUG_TYPE " options");
static llvm::cl::opt<unsigned long long>
- clCacheSizeKiB("tile-cache-size",
+ clCacheSizeKiB("affine-tile-cache-size",
llvm::cl::desc("Set size of cache to tile for in KiB"),
llvm::cl::cat(clOptionsCategory));
// Tile size to use for all loops (overrides -tile-sizes if provided).
static llvm::cl::opt<unsigned>
- clTileSize("tile-size", llvm::cl::desc("Use this tile size for all loops"),
+ clTileSize("affine-tile-size",
+ llvm::cl::desc("Use this tile size for all loops"),
llvm::cl::cat(clOptionsCategory));
// List of tile sizes. If any of them aren't provided, they are filled with
// clTileSize / kDefaultTileSize.
static llvm::cl::list<unsigned> clTileSizes(
- "tile-sizes",
+ "affine-tile-sizes",
llvm::cl::desc(
"List of tile sizes for each perfect nest (overridden by -tile-size)"),
llvm::cl::ZeroOrMore, llvm::cl::cat(clOptionsCategory));
diff --git a/mlir/lib/Transforms/LoopUnroll.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp
similarity index 99%
rename from mlir/lib/Transforms/LoopUnroll.cpp
rename to mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp
index ca1ed7729345..40187a7ebae7 100644
--- a/mlir/lib/Transforms/LoopUnroll.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp
@@ -10,10 +10,9 @@
//
//===----------------------------------------------------------------------===//
-#include "mlir/Transforms/Passes.h"
-
#include "mlir/Analysis/LoopAnalysis.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
+#include "mlir/Dialect/Affine/Passes.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/Builders.h"
diff --git a/mlir/lib/Transforms/LoopUnrollAndJam.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp
similarity index 99%
rename from mlir/lib/Transforms/LoopUnrollAndJam.cpp
rename to mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp
index 7d4be3490114..aa9d2834ad8d 100644
--- a/mlir/lib/Transforms/LoopUnrollAndJam.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp
@@ -32,10 +32,9 @@
// Note: 'if/else' blocks are not jammed. So, if there are loops inside if
// op's, bodies of those loops will not be jammed.
//===----------------------------------------------------------------------===//
-#include "mlir/Transforms/Passes.h"
-
#include "mlir/Analysis/LoopAnalysis.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
+#include "mlir/Dialect/Affine/Passes.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/BlockAndValueMapping.h"
diff --git a/mlir/lib/Transforms/Vectorize.cpp b/mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp
similarity index 99%
rename from mlir/lib/Transforms/Vectorize.cpp
rename to mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp
index 7d091b2f2433..d9a9ad969e51 100644
--- a/mlir/lib/Transforms/Vectorize.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp
@@ -1,4 +1,4 @@
-//===- Vectorize.cpp - Vectorize Pass Impl --------------------------------===//
+//===- SuperVectorize.cpp - Vectorize Pass Impl ---------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -16,6 +16,7 @@
#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Analysis/Utils.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
+#include "mlir/Dialect/Affine/Passes.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/Dialect/Vector/VectorOps.h"
#include "mlir/Dialect/Vector/VectorUtils.h"
@@ -27,7 +28,6 @@
#include "mlir/Support/Functional.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Transforms/FoldUtils.h"
-#include "mlir/Transforms/Passes.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
@@ -1268,10 +1268,10 @@ void Vectorize::runOnFunction() {
}
std::unique_ptr<OpPassBase<FuncOp>>
-mlir::createVectorizePass(ArrayRef<int64_t> virtualVectorSize) {
+mlir::createSuperVectorizePass(ArrayRef<int64_t> virtualVectorSize) {
return std::make_unique<Vectorize>(virtualVectorSize);
}
static PassRegistration<Vectorize>
- pass("affine-vectorize",
+ pass("affine-super-vectorize",
"Vectorize to a target independent n-D vector abstraction");
diff --git a/mlir/lib/Transforms/CMakeLists.txt b/mlir/lib/Transforms/CMakeLists.txt
index ac2bafb39e3a..8d3c5f46f8c4 100644
--- a/mlir/lib/Transforms/CMakeLists.txt
+++ b/mlir/lib/Transforms/CMakeLists.txt
@@ -9,15 +9,11 @@ add_mlir_library(MLIRTransforms
LoopCoalescing.cpp
LoopFusion.cpp
LoopInvariantCodeMotion.cpp
- LoopTiling.cpp
- LoopUnrollAndJam.cpp
- LoopUnroll.cpp
MemRefDataFlowOpt.cpp
OpStats.cpp
PipelineDataTransfer.cpp
StripDebugInfo.cpp
SymbolDCE.cpp
- Vectorize.cpp
ViewOpGraph.cpp
ViewRegionGraph.cpp
diff --git a/mlir/test/Transforms/Vectorize/compose_maps.mlir b/mlir/test/Dialect/Affine/SuperVectorize/compose_maps.mlir
similarity index 98%
rename from mlir/test/Transforms/Vectorize/compose_maps.mlir
rename to mlir/test/Dialect/Affine/SuperVectorize/compose_maps.mlir
index 1e6a0436e4b4..ca1641762838 100644
--- a/mlir/test/Transforms/Vectorize/compose_maps.mlir
+++ b/mlir/test/Dialect/Affine/SuperVectorize/compose_maps.mlir
@@ -1,4 +1,4 @@
-// RUN: mlir-opt %s -affine-vectorizer-test -compose-maps 2>&1 | FileCheck %s
+// RUN: mlir-opt %s -affine-super-vectorizer-test -compose-maps 2>&1 | FileCheck %s
// For all these cases, the test traverses the `test_affine_map` ops and
// composes them in order one-by-one.
diff --git a/mlir/test/Transforms/Vectorize/normalize_maps.mlir b/mlir/test/Dialect/Affine/SuperVectorize/normalize_maps.mlir
similarity index 96%
rename from mlir/test/Transforms/Vectorize/normalize_maps.mlir
rename to mlir/test/Dialect/Affine/SuperVectorize/normalize_maps.mlir
index 0d7785957427..7c2bacd1a46e 100644
--- a/mlir/test/Transforms/Vectorize/normalize_maps.mlir
+++ b/mlir/test/Dialect/Affine/SuperVectorize/normalize_maps.mlir
@@ -1,4 +1,4 @@
-// RUN: mlir-opt %s -affine-vectorizer-test -normalize-maps | FileCheck %s
+// RUN: mlir-opt %s -affine-super-vectorizer-test -normalize-maps | FileCheck %s
// CHECK-DAG: #[[ZERO:[a-zA-Z0-9]+]] = affine_map<() -> (0)>
// CHECK-DAG: #[[ID1:[a-zA-Z0-9]+]] = affine_map<(d0) -> (d0)>
diff --git a/mlir/test/Transforms/Vectorize/vector_utils.mlir b/mlir/test/Dialect/Affine/SuperVectorize/vector_utils.mlir
similarity index 85%
rename from mlir/test/Transforms/Vectorize/vector_utils.mlir
rename to mlir/test/Dialect/Affine/SuperVectorize/vector_utils.mlir
index e6d00b17130e..4e06028802a6 100644
--- a/mlir/test/Transforms/Vectorize/vector_utils.mlir
+++ b/mlir/test/Dialect/Affine/SuperVectorize/vector_utils.mlir
@@ -1,5 +1,5 @@
-// RUN: mlir-opt %s -affine-vectorizer-test -vector-shape-ratio 4 -vector-shape-ratio 8 2>&1 | FileCheck %s
-// RUN: mlir-opt %s -affine-vectorizer-test -vector-shape-ratio 2 -vector-shape-ratio 5 -vector-shape-ratio 2 2>&1 | FileCheck %s -check-prefix=TEST-3x4x5x8
+// RUN: mlir-opt %s -affine-super-vectorizer-test -vector-shape-ratio 4 -vector-shape-ratio 8 2>&1 | FileCheck %s
+// RUN: mlir-opt %s -affine-super-vectorizer-test -vector-shape-ratio 2 -vector-shape-ratio 5 -vector-shape-ratio 2 2>&1 | FileCheck %s -check-prefix=TEST-3x4x5x8
func @vector_add_2d(%arg0: index, %arg1: index) -> f32 {
// Nothing should be matched in this first block.
diff --git a/mlir/test/Transforms/Vectorize/vectorize_1d.mlir b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_1d.mlir
similarity index 99%
rename from mlir/test/Transforms/Vectorize/vectorize_1d.mlir
rename to mlir/test/Dialect/Affine/SuperVectorize/vectorize_1d.mlir
index da9c214edb1a..94943df75bd1 100644
--- a/mlir/test/Transforms/Vectorize/vectorize_1d.mlir
+++ b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_1d.mlir
@@ -1,4 +1,4 @@
-// RUN: mlir-opt %s -affine-vectorize="virtual-vector-size=128 test-fastest-varying=0" | FileCheck %s
+// RUN: mlir-opt %s -affine-super-vectorize="virtual-vector-size=128 test-fastest-varying=0" | FileCheck %s
// Permutation maps used in vectorization.
// CHECK: #[[map_proj_d0d1_0:map[0-9]+]] = affine_map<(d0, d1) -> (0)>
diff --git a/mlir/test/Transforms/Vectorize/vectorize_2d.mlir b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_2d.mlir
similarity index 97%
rename from mlir/test/Transforms/Vectorize/vectorize_2d.mlir
rename to mlir/test/Dialect/Affine/SuperVectorize/vectorize_2d.mlir
index f4d83baa520f..884907024bb1 100644
--- a/mlir/test/Transforms/Vectorize/vectorize_2d.mlir
+++ b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_2d.mlir
@@ -1,5 +1,5 @@
-// RUN: mlir-opt %s -affine-vectorize="virtual-vector-size=4,8" | FileCheck %s -check-prefix=VECT
-// RUN: mlir-opt %s -affine-vectorize="virtual-vector-size=32,256 test-fastest-varying=1,0" | FileCheck %s
+// RUN: mlir-opt %s -affine-super-vectorize="virtual-vector-size=4,8" | FileCheck %s -check-prefix=VECT
+// RUN: mlir-opt %s -affine-super-vectorize="virtual-vector-size=32,256 test-fastest-varying=1,0" | FileCheck %s
// Permutation maps used in vectorization.
// CHECK-DAG: #[[map_id1:map[0-9]+]] = affine_map<(d0) -> (d0)>
diff --git a/mlir/test/Transforms/Vectorize/vectorize_3d.mlir b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_3d.mlir
similarity index 90%
rename from mlir/test/Transforms/Vectorize/vectorize_3d.mlir
rename to mlir/test/Dialect/Affine/SuperVectorize/vectorize_3d.mlir
index 2fbe0fe7c452..2980ee30d908 100644
--- a/mlir/test/Transforms/Vectorize/vectorize_3d.mlir
+++ b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_3d.mlir
@@ -1,4 +1,4 @@
-// RUN: mlir-opt %s -affine-vectorize="virtual-vector-size=32,64,256 test-fastest-varying=2,1,0" | FileCheck %s
+// RUN: mlir-opt %s -affine-super-vectorize="virtual-vector-size=32,64,256 test-fastest-varying=2,1,0" | FileCheck %s
// Permutation maps used in vectorization.
// CHECK: #[[map_proj_d0d1d2_d0d1d2:map[0-9]+]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)>
diff --git a/mlir/test/Transforms/Vectorize/vectorize_outer_loop_2d.mlir b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_outer_loop_2d.mlir
similarity index 91%
rename from mlir/test/Transforms/Vectorize/vectorize_outer_loop_2d.mlir
rename to mlir/test/Dialect/Affine/SuperVectorize/vectorize_outer_loop_2d.mlir
index 0d5abdd70f55..c41c14d42390 100644
--- a/mlir/test/Transforms/Vectorize/vectorize_outer_loop_2d.mlir
+++ b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_outer_loop_2d.mlir
@@ -1,4 +1,4 @@
-// RUN: mlir-opt %s -affine-vectorize="virtual-vector-size=32,256 test-fastest-varying=2,0" | FileCheck %s
+// RUN: mlir-opt %s -affine-super-vectorize="virtual-vector-size=32,256 test-fastest-varying=2,0" | FileCheck %s
// Permutation maps used in vectorization.
// CHECK: #[[map_proj_d0d1d2_d0d2:map[0-9]+]] = affine_map<(d0, d1, d2) -> (d0, d2)>
diff --git a/mlir/test/Transforms/Vectorize/vectorize_outer_loop_transpose_2d.mlir b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_outer_loop_transpose_2d.mlir
similarity index 96%
rename from mlir/test/Transforms/Vectorize/vectorize_outer_loop_transpose_2d.mlir
rename to mlir/test/Dialect/Affine/SuperVectorize/vectorize_outer_loop_transpose_2d.mlir
index e9c1bbdfde3d..3dc3e69e6678 100644
--- a/mlir/test/Transforms/Vectorize/vectorize_outer_loop_transpose_2d.mlir
+++ b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_outer_loop_transpose_2d.mlir
@@ -1,4 +1,4 @@
-// RUN: mlir-opt %s -affine-vectorize="virtual-vector-size=32,256 test-fastest-varying=0,2" | FileCheck %s
+// RUN: mlir-opt %s -affine-super-vectorize="virtual-vector-size=32,256 test-fastest-varying=0,2" | FileCheck %s
// Permutation maps used in vectorization.
// CHECK: #[[map_proj_d0d1d2_d2d0:map[0-9]+]] = affine_map<(d0, d1, d2) -> (d2, d0)>
diff --git a/mlir/test/Transforms/Vectorize/vectorize_transpose_2d.mlir b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_transpose_2d.mlir
similarity index 96%
rename from mlir/test/Transforms/Vectorize/vectorize_transpose_2d.mlir
rename to mlir/test/Dialect/Affine/SuperVectorize/vectorize_transpose_2d.mlir
index d4a721f7bf99..893352a40db4 100644
--- a/mlir/test/Transforms/Vectorize/vectorize_transpose_2d.mlir
+++ b/mlir/test/Dialect/Affine/SuperVectorize/vectorize_transpose_2d.mlir
@@ -1,4 +1,4 @@
-// RUN: mlir-opt %s -affine-vectorize="virtual-vector-size=32,256 test-fastest-varying=0,1" | FileCheck %s
+// RUN: mlir-opt %s -affine-super-vectorize="virtual-vector-size=32,256 test-fastest-varying=0,1" | FileCheck %s
// Permutation maps used in vectorization.
// CHECK-DAG: #[[map_proj_d0d1d2_d2d1:map[0-9]+]] = affine_map<(d0, d1, d2) -> (d2, d1)>
diff --git a/mlir/test/Transforms/affine-data-copy.mlir b/mlir/test/Dialect/Affine/affine-data-copy.mlir
similarity index 100%
rename from mlir/test/Transforms/affine-data-copy.mlir
rename to mlir/test/Dialect/Affine/affine-data-copy.mlir
diff --git a/mlir/test/Transforms/affine-loop-invariant-code-motion.mlir b/mlir/test/Dialect/Affine/affine-loop-invariant-code-motion.mlir
similarity index 100%
rename from mlir/test/Transforms/affine-loop-invariant-code-motion.mlir
rename to mlir/test/Dialect/Affine/affine-loop-invariant-code-motion.mlir
diff --git a/mlir/test/Transforms/dma-generate.mlir b/mlir/test/Dialect/Affine/dma-generate.mlir
similarity index 100%
rename from mlir/test/Transforms/dma-generate.mlir
rename to mlir/test/Dialect/Affine/dma-generate.mlir
diff --git a/mlir/test/Transforms/loop-tiling.mlir b/mlir/test/Dialect/Affine/loop-tiling.mlir
similarity index 97%
rename from mlir/test/Transforms/loop-tiling.mlir
rename to mlir/test/Dialect/Affine/loop-tiling.mlir
index c0a583f52cf4..2f8223b37eeb 100644
--- a/mlir/test/Transforms/loop-tiling.mlir
+++ b/mlir/test/Dialect/Affine/loop-tiling.mlir
@@ -1,5 +1,5 @@
-// RUN: mlir-opt %s -split-input-file -affine-loop-tile -tile-size=32 | FileCheck %s
-// RUN: mlir-opt %s -split-input-file -affine-loop-tile -tile-cache-size=512 | FileCheck %s --check-prefix=MODEL
+// RUN: mlir-opt %s -split-input-file -affine-loop-tile -affine-tile-size=32 | FileCheck %s
+// RUN: mlir-opt %s -split-input-file -affine-loop-tile -affine-tile-cache-size=512 | FileCheck %s --check-prefix=MODEL
// -----
diff --git a/mlir/test/Transforms/parallelism-detection.mlir b/mlir/test/Dialect/Affine/parallelism-detection.mlir
similarity index 100%
rename from mlir/test/Transforms/parallelism-detection.mlir
rename to mlir/test/Dialect/Affine/parallelism-detection.mlir
diff --git a/mlir/test/Transforms/simplify-affine-structures.mlir b/mlir/test/Dialect/Affine/simplify-affine-structures.mlir
similarity index 100%
rename from mlir/test/Transforms/simplify-affine-structures.mlir
rename to mlir/test/Dialect/Affine/simplify-affine-structures.mlir
diff --git a/mlir/test/Transforms/slicing-utils.mlir b/mlir/test/Dialect/Affine/slicing-utils.mlir
similarity index 97%
rename from mlir/test/Transforms/slicing-utils.mlir
rename to mlir/test/Dialect/Affine/slicing-utils.mlir
index 145695db5fbe..251e400a9b52 100644
--- a/mlir/test/Transforms/slicing-utils.mlir
+++ b/mlir/test/Dialect/Affine/slicing-utils.mlir
@@ -1,6 +1,6 @@
-// RUN: mlir-opt %s -affine-vectorizer-test -forward-slicing=true 2>&1 | FileCheck %s --check-prefix=FWD
-// RUN: mlir-opt %s -affine-vectorizer-test -backward-slicing=true 2>&1 | FileCheck %s --check-prefix=BWD
-// RUN: mlir-opt %s -affine-vectorizer-test -slicing=true 2>&1 | FileCheck %s --check-prefix=FWDBWD
+// RUN: mlir-opt %s -affine-super-vectorizer-test -forward-slicing=true 2>&1 | FileCheck %s --check-prefix=FWD
+// RUN: mlir-opt %s -affine-super-vectorizer-test -backward-slicing=true 2>&1 | FileCheck %s --check-prefix=BWD
+// RUN: mlir-opt %s -affine-super-vectorizer-test -slicing=true 2>&1 | FileCheck %s --check-prefix=FWDBWD
/// 1 2 3 4
/// |_______| |______|
diff --git a/mlir/test/Transforms/unroll-jam.mlir b/mlir/test/Dialect/Affine/unroll-jam.mlir
similarity index 100%
rename from mlir/test/Transforms/unroll-jam.mlir
rename to mlir/test/Dialect/Affine/unroll-jam.mlir
diff --git a/mlir/test/Transforms/unroll.mlir b/mlir/test/Dialect/Affine/unroll.mlir
similarity index 100%
rename from mlir/test/Transforms/unroll.mlir
rename to mlir/test/Dialect/Affine/unroll.mlir
diff --git a/mlir/test/lib/Dialect/Affine/CMakeLists.txt b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
index 905d1c1adf3d..0d6cd2aa9edc 100644
--- a/mlir/test/lib/Dialect/Affine/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
@@ -1,5 +1,7 @@
add_llvm_library(MLIRAffineTransformsTestPasses
TestAffineDataCopy.cpp
+ TestParallelismDetection.cpp
+ TestVectorizationUtils.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Affine
diff --git a/mlir/test/lib/Transforms/TestParallelismDetection.cpp b/mlir/test/lib/Dialect/Affine/TestParallelismDetection.cpp
similarity index 99%
rename from mlir/test/lib/Transforms/TestParallelismDetection.cpp
rename to mlir/test/lib/Dialect/Affine/TestParallelismDetection.cpp
index ea4bbae2a82a..1140dab92dbb 100644
--- a/mlir/test/lib/Transforms/TestParallelismDetection.cpp
+++ b/mlir/test/lib/Dialect/Affine/TestParallelismDetection.cpp
@@ -26,7 +26,6 @@ struct TestParallelismDetection
} // end anonymous namespace
-
// Walks the function and emits a note for all 'affine.for' ops detected as
// parallel.
void TestParallelismDetection::runOnFunction() {
diff --git a/mlir/test/lib/Transforms/TestVectorizationUtils.cpp b/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
similarity index 98%
rename from mlir/test/lib/Transforms/TestVectorizationUtils.cpp
rename to mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
index af42c90521d4..01382530fa39 100644
--- a/mlir/test/lib/Transforms/TestVectorizationUtils.cpp
+++ b/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
@@ -27,7 +27,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
-#define DEBUG_TYPE "affine-vectorizer-test"
+#define DEBUG_TYPE "affine-super-vectorizer-test"
using namespace mlir;
@@ -284,6 +284,7 @@ void VectorizerTestPass::runOnFunction() {
namespace mlir {
void registerVectorizerTestPass() {
PassRegistration<VectorizerTestPass> pass(
- "affine-vectorizer-test", "Tests vectorizer standalone functionality.");
+ "affine-super-vectorizer-test",
+ "Tests vectorizer standalone functionality.");
}
} // namespace mlir
diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt
index 9340e89a3b90..b4726439c83f 100644
--- a/mlir/test/lib/Transforms/CMakeLists.txt
+++ b/mlir/test/lib/Transforms/CMakeLists.txt
@@ -15,10 +15,8 @@ add_llvm_library(MLIRTestTransforms
TestMemRefBoundCheck.cpp
TestMemRefDependenceCheck.cpp
TestMemRefStrideCalculation.cpp
- TestParallelismDetection.cpp
TestVectorToLoopsConversion.cpp
TestVectorTransforms.cpp
- TestVectorizationUtils.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms
More information about the Mlir-commits
mailing list