forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VectorExt] Teach vectorization to to_layout (iree-org#18092)
This patch adds a pass to vectorize iree_vector_ext.to_layout operations. This allows us to set layouts at linalg level and distribute later in the pipeline.
- Loading branch information
Showing
18 changed files
with
344 additions
and
44 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
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
56 changes: 56 additions & 0 deletions
56
compiler/src/iree/compiler/Codegen/Dialect/VectorExt/Transforms/BUILD.bazel
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,56 @@ | ||
# Copyright 2024 The IREE Authors | ||
# | ||
# Licensed 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 | ||
|
||
load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library", "iree_gentbl_cc_library") | ||
|
||
package( | ||
default_visibility = ["//visibility:public"], | ||
features = ["layering_check"], | ||
licenses = ["notice"], # Apache 2.0 | ||
) | ||
|
||
iree_gentbl_cc_library( | ||
name = "PassesIncGen", | ||
tbl_outs = [ | ||
( | ||
["--gen-pass-decls"], | ||
"Passes.h.inc", | ||
), | ||
], | ||
tblgen = "@llvm-project//mlir:mlir-tblgen", | ||
td_file = "Passes.td", | ||
deps = [ | ||
"@llvm-project//mlir:PassBaseTdFiles", | ||
], | ||
) | ||
|
||
iree_compiler_cc_library( | ||
name = "VectorExtTransforms", | ||
srcs = [ | ||
"Passes.cpp", | ||
"VectorizeIREEVectorExtOps.cpp", | ||
], | ||
hdrs = [ | ||
"Passes.h", | ||
"Passes.h.inc", | ||
], | ||
deps = [ | ||
":PassesIncGen", | ||
"//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect", | ||
"@llvm-project//llvm:Support", | ||
"@llvm-project//mlir:ArithDialect", | ||
"@llvm-project//mlir:FunctionInterfaces", | ||
"@llvm-project//mlir:IR", | ||
"@llvm-project//mlir:Pass", | ||
"@llvm-project//mlir:Support", | ||
"@llvm-project//mlir:TensorDialect", | ||
"@llvm-project//mlir:TransformUtils", | ||
"@llvm-project//mlir:Transforms", | ||
"@llvm-project//mlir:VectorDialect", | ||
"@llvm-project//mlir:VectorTransforms", | ||
"@llvm-project//mlir:VectorUtils", | ||
], | ||
) |
49 changes: 49 additions & 0 deletions
49
compiler/src/iree/compiler/Codegen/Dialect/VectorExt/Transforms/CMakeLists.txt
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,49 @@ | ||
################################################################################ | ||
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from # | ||
# compiler/src/iree/compiler/Codegen/Dialect/VectorExt/Transforms/BUILD.bazel # | ||
# # | ||
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary # | ||
# CMake-only content. # | ||
# # | ||
# To disable autogeneration for this file entirely, delete this header. # | ||
################################################################################ | ||
|
||
iree_add_all_subdirs() | ||
|
||
iree_tablegen_library( | ||
NAME | ||
PassesIncGen | ||
TD_FILE | ||
"Passes.td" | ||
OUTS | ||
--gen-pass-decls Passes.h.inc | ||
) | ||
|
||
iree_cc_library( | ||
NAME | ||
VectorExtTransforms | ||
HDRS | ||
"Passes.h" | ||
"Passes.h.inc" | ||
SRCS | ||
"Passes.cpp" | ||
"VectorizeIREEVectorExtOps.cpp" | ||
DEPS | ||
::PassesIncGen | ||
LLVMSupport | ||
MLIRArithDialect | ||
MLIRFunctionInterfaces | ||
MLIRIR | ||
MLIRPass | ||
MLIRSupport | ||
MLIRTensorDialect | ||
MLIRTransformUtils | ||
MLIRTransforms | ||
MLIRVectorDialect | ||
MLIRVectorTransforms | ||
MLIRVectorUtils | ||
iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect | ||
PUBLIC | ||
) | ||
|
||
### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ### |
22 changes: 22 additions & 0 deletions
22
compiler/src/iree/compiler/Codegen/Dialect/VectorExt/Transforms/Passes.cpp
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,22 @@ | ||
// Copyright 2024 The IREE Authors | ||
// | ||
// Licensed 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 | ||
|
||
#include "iree/compiler/Codegen/Dialect/VectorExt/Transforms/Passes.h" | ||
|
||
namespace mlir::iree_compiler { | ||
|
||
namespace IREE::VectorExt { | ||
namespace { | ||
#define GEN_PASS_REGISTRATION | ||
#include "iree/compiler/Codegen/Dialect/VectorExt/Transforms/Passes.h.inc" | ||
} // namespace | ||
} // namespace IREE::VectorExt | ||
|
||
void registerIREEVectorExtPasses() { | ||
// Generated. | ||
IREE::VectorExt::registerPasses(); | ||
} | ||
} // namespace mlir::iree_compiler |
23 changes: 23 additions & 0 deletions
23
compiler/src/iree/compiler/Codegen/Dialect/VectorExt/Transforms/Passes.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2024 The IREE Authors | ||
// | ||
// Licensed 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 | ||
|
||
#ifndef IREE_COMPILER_CODEGEN_DIALECT_VECTOR_EXT_TRANSFORMS_PASSES_H_ | ||
#define IREE_COMPILER_CODEGEN_DIALECT_VECTOR_EXT_TRANSFORMS_PASSES_H_ | ||
|
||
#include "mlir/Interfaces/FunctionInterfaces.h" | ||
#include "mlir/Pass/Pass.h" | ||
|
||
namespace mlir::iree_compiler::IREE::VectorExt { | ||
#define GEN_PASS_DECL | ||
#include "iree/compiler/Codegen/Dialect/VectorExt/Transforms/Passes.h.inc" // IWYU pragma: keep | ||
} // namespace mlir::iree_compiler::IREE::VectorExt | ||
|
||
namespace mlir::iree_compiler { | ||
/// Register VectorExt passes. | ||
void registerIREEVectorExtPasses(); | ||
} // namespace mlir::iree_compiler | ||
|
||
#endif // IREE_COMPILER_CODEGEN_DIALECT_VECTOR_EXT_TRANSFORMS_PASSES_H_ |
Oops, something went wrong.