Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ iree_td_library(
"@llvm-project//mlir:InferTypeOpInterfaceTdFiles",
"@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:SideEffectInterfacesTdFiles",
"@llvm-project//mlir:ValueBoundsOpInterfaceTdFiles",
"@llvm-project//mlir:VectorInterfacesTdFiles",
],
)
Expand Down Expand Up @@ -82,6 +83,7 @@ iree_compiler_cc_library(
"@llvm-project//mlir:SideEffectInterfaces",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:ValueBoundsOpInterface",
"@llvm-project//mlir:VectorDialect",
"@llvm-project//mlir:VectorInterfaces",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ iree_cc_library(
MLIRSideEffectInterfaces
MLIRSupport
MLIRTensorDialect
MLIRValueBoundsOpInterface
MLIRVectorDialect
MLIRVectorInterfaces
iree::compiler::Codegen::Utils::VectorOpUtils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "mlir/IR/OpDefinition.h"
#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Interfaces/ValueBoundsOpInterface.h"
#include "mlir/Interfaces/VectorInterfaces.h"

// clang-format off: must be included after all LLVM/MLIR headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Interfaces/ValueBoundsOpInterface.h"

using namespace mlir;
using namespace mlir::iree_compiler::IREE::VectorExt;
Expand All @@ -26,6 +27,11 @@ LogicalResult ToLayoutOp::verify() {
return getLayout().isValidLayout(getInput().getType(), getLoc());
}

void ToLayoutOp::populateBoundsForShapedValueDim(
Value value, int64_t dim, ValueBoundsConstraintSet &cstr) {
cstr.bound(value)[dim] == cstr.getExpr(getInput(), dim);
}

// to_simd -> to_simt
OpFoldResult ToSIMDOp::fold(FoldAdaptor) {
if (auto simtOp = getOperand().getDefiningOp<ToSIMTOp>()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtInterfaces.td"
include "mlir/IR/OpBase.td"
include "mlir/Interfaces/ControlFlowInterfaces.td"
include "mlir/Interfaces/SideEffectInterfaces.td"
include "mlir/Interfaces/ValueBoundsOpInterface.td"

//===----------------------------------------------------------------------===//
// Base class.
Expand All @@ -29,7 +30,9 @@ class IREEVectorExt_PureOp<string mnemonic, list<Trait> traits = []> :

def IREEVectorExt_ToLayoutOp : IREEVectorExt_PureOp<"to_layout", [
Pure,
AllTypesMatch<["input", "output"]>
AllTypesMatch<["input", "output"]>,
DeclareOpInterfaceMethods<ValueBoundsOpInterface,
["populateBoundsForShapedValueDim"]>
]> {
let summary = [{Layout conversion operator.}];
let description = [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ iree_compiler_cc_library(
"LowerTransferGatherOps.cpp",
"Passes.cpp",
"VectorExtFoldUnitExtentDims.cpp",
"VectorizeIREEVectorExtOps.cpp",
],
hdrs = [
"BufferizationInterfaces.h",
Expand All @@ -52,7 +51,6 @@ iree_compiler_cc_library(
deps = [
":PassesIncGen",
"//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect",
"//compiler/src/iree/compiler/Codegen/Interfaces:VectorizableOpInterface",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:ArithDialect",
"@llvm-project//mlir:BufferizationDialect",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ iree_cc_library(
"LowerTransferGatherOps.cpp"
"Passes.cpp"
"VectorExtFoldUnitExtentDims.cpp"
"VectorizeIREEVectorExtOps.cpp"
DEPS
::PassesIncGen
LLVMSupport
Expand All @@ -52,7 +51,6 @@ iree_cc_library(
MLIRVectorDialect
MLIRVectorUtils
iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect
iree::compiler::Codegen::Interfaces::VectorizableOpInterface
PUBLIC
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@

include "mlir/Pass/PassBase.td"

def VectorizeIREEVectorExtOpsPass :
Pass<"iree-vector-ext-vectorize-ops", ""> {
let summary = "Vectorizes then lowers a few iree_vector_ext ops before vectorization.";
let dependentDialects = [
"::mlir::iree_compiler::IREE::VectorExt::IREEVectorExtDialect"
];
}

def VectorExtFoldUnitExtentDimsPass :
Pass<"iree-vector-ext-fold-unit-extent-dims", ""> {
let summary = "Folds unit dims for iree_vector_ext ops";
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: iree-opt %s -pass-pipeline='builtin.module(func.func(iree-vector-ext-vectorize-ops, iree-codegen-generic-vectorization{enable-vector-masking=true}),canonicalize,cse,func.func(iree-codegen-optimize-tensor-insert-extract-slices),canonicalize)' --split-input-file --mlir-print-local-scope | FileCheck %s
// RUN: iree-opt %s -pass-pipeline='builtin.module(func.func(iree-codegen-generic-vectorization{enable-vector-masking=true}),canonicalize,cse,func.func(iree-codegen-optimize-tensor-insert-extract-slices),canonicalize)' --split-input-file --mlir-print-local-scope | FileCheck %s

#layout = #iree_vector_ext.nested_layout<
subgroup_tile = [1, 1],
Expand Down
3 changes: 0 additions & 3 deletions compiler/src/iree/compiler/Codegen/LLVMGPU/Passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "iree/compiler/Codegen/Common/Passes.h"
#include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenOps.h"
#include "iree/compiler/Codegen/Dialect/GPU/Transforms/Passes.h"
#include "iree/compiler/Codegen/Dialect/VectorExt/Transforms/Passes.h"
#include "iree/compiler/Codegen/LLVMGPU/Passes.h"
#include "iree/compiler/Codegen/LLVMGPU/ROCDLPasses.h"
#include "iree/compiler/Codegen/Utils/GPUUtils.h"
Expand Down Expand Up @@ -274,8 +273,6 @@ static void addGPUVectorizationPasses(OpPassManager &funcPassManager,
funcPassManager.addPass(IREE::LinalgExt::createDecomposeIm2colPass());
funcPassManager.addPass(createCanonicalizerPass());
funcPassManager.addPass(createCSEPass());
funcPassManager.addPass(
IREE::VectorExt::createVectorizeIREEVectorExtOpsPass());
funcPassManager.addPass(IREE::GPU::createVectorizeIREEGPUOpsPass());
// Vectorize.
GenericVectorizationPassOptions options;
Expand Down
Loading