Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir][vector][NFC] Split into IR, Transforms and Utils
This reduces the dependencies of the MLIRVector target and makes the dialect consistent with other dialects. Differential Revision: https://reviews.llvm.org/D118533
- Loading branch information
1 parent
b8290ff
commit 99ef9ee
Showing
72 changed files
with
452 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//===- IndexingUtils.h - Helpers related to index computations --*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This header file defines utilities and common canonicalization patterns for | ||
// reshape operations. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef MLIR_DIALECT_UTILS_INDEXINGUTILS_H | ||
#define MLIR_DIALECT_UTILS_INDEXINGUTILS_H | ||
|
||
#include "mlir/Support/LLVM.h" | ||
#include "llvm/ADT/ArrayRef.h" | ||
#include "llvm/ADT/SmallVector.h" | ||
|
||
namespace mlir { | ||
class ArrayAttr; | ||
|
||
/// Computes and returns the linearized index of 'offsets' w.r.t. 'basis'. | ||
int64_t linearize(ArrayRef<int64_t> offsets, ArrayRef<int64_t> basis); | ||
|
||
/// Given the strides together with a linear index in the dimension | ||
/// space, returns the vector-space offsets in each dimension for a | ||
/// de-linearized index. | ||
SmallVector<int64_t, 4> delinearize(ArrayRef<int64_t> strides, | ||
int64_t linearIndex); | ||
|
||
/// Helper that returns a subset of `arrayAttr` as a vector of int64_t. | ||
SmallVector<int64_t, 4> getI64SubArray(ArrayAttr arrayAttr, | ||
unsigned dropFront = 0, | ||
unsigned dropBack = 0); | ||
} // namespace mlir | ||
|
||
#endif // MLIR_DIALECT_UTILS_INDEXINGUTILS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
add_mlir_dialect(VectorOps vector) | ||
add_mlir_doc(VectorOps VectorOps Dialects/ -gen-op-doc) | ||
|
||
set(LLVM_TARGET_DEFINITIONS VectorOps.td) | ||
mlir_tablegen(VectorOpsEnums.h.inc -gen-enum-decls) | ||
mlir_tablegen(VectorOpsEnums.cpp.inc -gen-enum-defs) | ||
add_public_tablegen_target(MLIRVectorOpsEnumsIncGen) | ||
add_dependencies(mlir-headers MLIRVectorOpsEnumsIncGen) | ||
add_subdirectory(IR) | ||
add_subdirectory(Transforms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
add_mlir_dialect(VectorOps vector) | ||
add_mlir_doc(VectorOps VectorOps Dialects/ -gen-op-doc) | ||
|
||
set(LLVM_TARGET_DEFINITIONS VectorOps.td) | ||
mlir_tablegen(VectorOpsEnums.h.inc -gen-enum-decls) | ||
mlir_tablegen(VectorOpsEnums.cpp.inc -gen-enum-defs) | ||
add_public_tablegen_target(MLIRVectorOpsEnumsIncGen) | ||
add_dependencies(mlir-headers MLIRVectorOpsEnumsIncGen) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# This dialect does currently not have any passes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ add_mlir_conversion_library(MLIRVectorToGPU | |
MLIRMemRef | ||
MLIRTransforms | ||
MLIRVector | ||
MLIRVectorUtils | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ add_mlir_conversion_library(MLIRVectorToSCF | |
MLIRMemRef | ||
MLIRTransforms | ||
MLIRVector | ||
MLIRVectorTransforms | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.