blob: c18a35e4cee3760d08ff33c7570700d072fc5053 [file] [log] [blame]
# Copyright 2019 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 = "PassHeaders",
hdrs = [
"PassDetail.h",
"Passes.h",
"Passes.h.inc",
],
deps = [
":PassesIncGen",
"//compiler/src/iree/compiler/Codegen/Dialect:IREECodegenDialect",
"//compiler/src/iree/compiler/Dialect/HAL/IR",
"//compiler/src/iree/compiler/Utils",
"@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:Transforms",
],
)
iree_gentbl_cc_library(
name = "FoldTensorExtractOpIncGen",
tbl_outs = [
(
["--gen-rewriters"],
"FoldTensorExtractOp.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "FoldTensorExtractOp.td",
deps = [
"@llvm-project//mlir:BufferizableOpInterfaceTdFiles",
"@llvm-project//mlir:BufferizationOpsTdFiles",
"@llvm-project//mlir:MemRefOpsTdFiles",
"@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:TensorOpsTdFiles",
],
)
# TODO: If the layering causes concerns then the transform dialect interpreter
# should be one level above everything: it is a mechanism by which
# transformations are applied to any IR and needs to register all the dialects
# that may be produced.
# In particular, a single IREE-side transform interpreter is enough to perform
# all kind of transformations and not just codegen.
# This is an opportunity to retire the specific interpreter that is used for
# creating dispatch regions with the transform dialect, but only once the
# layering is correct.
iree_compiler_cc_library(
name = "TransformDialectInterpreterPass",
srcs = [
"TransformDialectInterpreterPass.cpp",
],
deps = [
":PassHeaders",
":PassesIncGen",
# Dialects
"//compiler/src/iree/compiler/Dialect/Flow/IR",
"//llvm-external-projects/iree-dialects:IREELinalgExtDialect",
"//llvm-external-projects/iree-dialects:IREELinalgExtTransformOps",
"//llvm-external-projects/iree-dialects:IREELinalgTransformDialect",
"@llvm-project//mlir:AffineDialect",
"@llvm-project//mlir:AffineUtils",
"@llvm-project//mlir:AsyncDialect",
"@llvm-project//mlir:ArithDialect",
"@llvm-project//mlir:ArithUtils",
"@llvm-project//mlir:BufferizationDialect",
"@llvm-project//mlir:BufferizationTransforms",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:GPUDialect",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:LLVMDialect",
"@llvm-project//mlir:PDLDialect",
"@llvm-project//mlir:PDLInterpDialect",
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:SCFUtils",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:TransformDialect",
"@llvm-project//mlir:TransformDialectTransforms",
"@llvm-project//mlir:VectorDialect",
# IR
"@llvm-project//mlir:Analysis",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:Rewrite",
# Interfaces
# Transforms (needed mostly for the BufferizableOpInterfaceImpl)
"@llvm-project//mlir:ArithTransforms",
"@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:SCFTransforms",
"@llvm-project//mlir:TensorTransforms",
"@llvm-project//mlir:VectorTransforms",
# Other Stuff
"//compiler/src/iree/compiler/Utils",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:DialectUtils",
# TransformStrategies
"//compiler/src/iree/compiler/Codegen/TransformStrategies/Common:TransformStrategies",
# TransformExtensions (needed for registration in the pass)
"//llvm-external-projects/iree-dialects:IREEDialectsTransforms",
"//compiler/src/iree/compiler/Codegen/Common/TransformExtensions:CommonExtensions",
"//compiler/src/iree/compiler/Dialect/Flow/TransformExtensions:FlowExtensions",
"//compiler/src/iree/compiler/Codegen/LLVMCPU/TransformExtensions:LLVMCPUExtensions",
"//compiler/src/iree/compiler/Codegen/LLVMGPU/TransformExtensions:LLVMGPUExtensions",
"@llvm-project//mlir:AffineTransformOps",
"@llvm-project//mlir:BufferizationTransformOps",
"@llvm-project//mlir:GPUTransformOps",
"@llvm-project//mlir:LinalgTransformOps",
"@llvm-project//mlir:MemRefTransformOps",
"@llvm-project//mlir:SCFTransformOps",
"@llvm-project//mlir:TensorTransformOps",
"@llvm-project//mlir:VectorTransformOps",
],
)
iree_compiler_cc_library(
name = "Common",
srcs = [
"BubbleUpOrdinalOps.cpp",
"BufferizationAnalysis.cpp",
"BufferizeCopyOnlyDispatchesPass.cpp",
"CleanupBufferAllocViewPass.cpp",
"ConcretizePadResultShape.cpp",
"ConvertBf16ArithToF32.cpp",
"ConvertBf16ToUInt16Buffers.cpp",
"ConvertToDestinationPassingStylePass.cpp",
"DecomposeAffineOpsPass.cpp",
"DecomposeConvolutionToLowerDimOps.cpp",
"DecomposeLinalgGeneric.cpp",
"DecomposePackUnPackOps.cpp",
"EraseHALDescriptorTypeFromMemRef.cpp",
"ExtractAddressComputation.cpp",
"FlattenMemRefSubspanPass.cpp",
"FoldAffineMinInDistributedLoops.cpp",
"FoldTensorExtractOpPass.cpp",
"ForOpCanonicalizationPass.cpp",
"FuseTensorPadWithConsumer.cpp",
"GenericVectorization.cpp",
"HoistStaticallyBoundAllocations.cpp",
"IREEComprehensiveBufferizePass.cpp",
"IREEExpandStridedMetadata.cpp",
"InstrumentMemoryAccesses.cpp",
"LowerUKernelsToCalls.cpp",
"MaterializeEncodingIntoPackUnPack.cpp",
"MemrefCopyToLinalg.cpp",
"OptimizeVectorTransferPass.cpp",
"PadDynamicAlloc.cpp",
"Passes.cpp",
"PolynomialApproximationPass.cpp",
"RematerializeParallelOps.cpp",
"RemoveTrivialLoops.cpp",
"SplitFullPartialTransferPass.cpp",
"TestExecutablePreprocessing.cpp",
"TestPartitionableLoopsInterface.cpp",
"TileAndDistributeToWorkgroupsPass.cpp",
"TileDispatchUsingInterface.cpp",
"TypePropagationPass.cpp",
"UserConfig.cpp",
"VectorizePad.cpp",
],
hdrs = [
"BufferizationAnalysis.h",
"EncodingInfo.h",
"ExtractAddressComputation.h",
"Passes.h",
"Transforms.h",
"UserConfig.h",
],
deps = [
":PassHeaders",
":PassesIncGen",
"//compiler/src/iree/compiler/Codegen/Common:FoldTensorExtractOpIncGen",
"//compiler/src/iree/compiler/Codegen/Dialect:IREECodegenDialect",
"//compiler/src/iree/compiler/Codegen/Interfaces:BufferizationInterfaces",
"//compiler/src/iree/compiler/Codegen/Interfaces:PartitionableLoopsInterface",
"//compiler/src/iree/compiler/Codegen/Interfaces:UKernelOpInterface",
"//compiler/src/iree/compiler/Codegen/Transforms",
"//compiler/src/iree/compiler/Codegen/Utils",
"//compiler/src/iree/compiler/Dialect/Flow/IR",
"//compiler/src/iree/compiler/Dialect/HAL/IR",
"//compiler/src/iree/compiler/Dialect/Util/IR",
"//compiler/src/iree/compiler/Dialect/VMVX/IR",
"//compiler/src/iree/compiler/Dialect/VMVX/IR:VMVXDialect",
"//compiler/src/iree/compiler/Utils",
"//llvm-external-projects/iree-dialects:IREELinalgExtDialect",
"//llvm-external-projects/iree-dialects:IREELinalgExtPasses",
"//llvm-external-projects/iree-dialects:IREELinalgExtTransforms",
"//runtime/src/iree/builtins/ukernel:exported_bits",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:AffineAnalysis",
"@llvm-project//mlir:AffineDialect",
"@llvm-project//mlir:AffineTransforms",
"@llvm-project//mlir:AffineUtils",
"@llvm-project//mlir:Analysis",
"@llvm-project//mlir:ArithDialect",
"@llvm-project//mlir:ArithTransforms",
"@llvm-project//mlir:ArithUtils",
"@llvm-project//mlir:BufferizationDialect",
"@llvm-project//mlir:BufferizationTransforms",
"@llvm-project//mlir:DialectUtils",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:GPUDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:LLVMCommonConversion",
"@llvm-project//mlir:LLVMDialect",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:LinalgUtils",
"@llvm-project//mlir:MathDialect",
"@llvm-project//mlir:MathTransforms",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:MemRefTransforms",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:SCFToControlFlow",
"@llvm-project//mlir:SCFTransforms",
"@llvm-project//mlir:SCFUtils",
"@llvm-project//mlir:SideEffectInterfaces",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:TensorTransforms",
"@llvm-project//mlir:TensorUtils",
"@llvm-project//mlir:TilingInterface",
"@llvm-project//mlir:TransformDialect",
"@llvm-project//mlir:Transforms",
"@llvm-project//mlir:ValueBoundsOpInterface",
"@llvm-project//mlir:VectorDialect",
"@llvm-project//mlir:VectorTransforms",
"@llvm-project//mlir:ViewLikeInterface",
],
)