forked from OSchip/llvm-project
[mlir] Trim a huge number of unnecessary dependencies on the Func dialect
The Func has a large number of legacy dependencies carried over from the old Standard dialect, which was pervasive and contained a large number of varied operations. With the split of the standard dialect and its demise, a lot of lingering dead dependencies have survived to the Func dialect. This commit removes a large majority of then, greatly reducing the dependence surface area of the Func dialect.
This commit is contained in:
parent
23aa5a7446
commit
1f971e23f0
|
@ -19,6 +19,7 @@ add_flang_library(FIRTransforms
|
|||
FIRBuilder
|
||||
FIRDialect
|
||||
MLIRAffineUtils
|
||||
MLIRFunc
|
||||
MLIRLLVMIR
|
||||
MLIROpenACC
|
||||
MLIROpenMP
|
||||
|
|
|
@ -67,7 +67,6 @@ def ConvertAffineToStandard : Pass<"lower-affine"> {
|
|||
}];
|
||||
let constructor = "mlir::createLowerAffinePass()";
|
||||
let dependentDialects = [
|
||||
"func::FuncDialect",
|
||||
"memref::MemRefDialect",
|
||||
"scf::SCFDialect",
|
||||
"vector::VectorDialect"
|
||||
|
@ -227,7 +226,7 @@ def ConvertGpuOpsToNVVMOps : Pass<"convert-gpu-to-nvvm", "gpu::GPUModuleOp"> {
|
|||
let summary = "Generate NVVM operations for gpu operations";
|
||||
let constructor = "mlir::createLowerGpuOpsToNVVMOpsPass()";
|
||||
let dependentDialects = [
|
||||
"func::FuncDialect",
|
||||
"cf::ControlFlowDialect",
|
||||
"memref::MemRefDialect",
|
||||
"NVVM::NVVMDialect",
|
||||
];
|
||||
|
@ -553,7 +552,6 @@ def ConvertShapeToStandard : Pass<"convert-shape-to-std", "ModuleOp"> {
|
|||
"dialect";
|
||||
let constructor = "mlir::createConvertShapeToStandardPass()";
|
||||
let dependentDialects = [
|
||||
"func::FuncDialect",
|
||||
"scf::SCFDialect",
|
||||
];
|
||||
}
|
||||
|
@ -705,7 +703,6 @@ def TosaToStandard : Pass<"tosa-to-standard"> {
|
|||
let summary = "Lower TOSA to the Standard dialect";
|
||||
let dependentDialects = [
|
||||
"arith::ArithmeticDialect",
|
||||
"func::FuncDialect",
|
||||
"tensor::TensorDialect",
|
||||
];
|
||||
let description = [{
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#define MLIR_DIALECT_AFFINE_ANALYSIS_AFFINEANALYSIS_H
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/IR/Value.h"
|
||||
#include "llvm/ADT/Optional.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
|
|
|
@ -21,6 +21,7 @@ class AffineForOp;
|
|||
class AffineIfOp;
|
||||
class AffineParallelOp;
|
||||
class DominanceInfo;
|
||||
class FuncOp;
|
||||
class Operation;
|
||||
class PostDominanceInfo;
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ def ArithmeticBufferize : Pass<"arith-bufferize", "ModuleOp"> {
|
|||
def ArithmeticExpandOps : Pass<"arith-expand"> {
|
||||
let summary = "Legalize Arithmetic ops to be convertible to LLVM.";
|
||||
let constructor = "mlir::arith::createArithmeticExpandOpsPass()";
|
||||
let dependentDialects = ["func::FuncDialect"];
|
||||
}
|
||||
|
||||
#endif // MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "mlir/Interfaces/SideEffectInterfaces.h"
|
||||
|
||||
#include "mlir/Dialect/ArmSVE/ArmSVEDialect.h.inc"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
|
||||
#define GET_OP_CLASSES
|
||||
#include "mlir/Dialect/ArmSVE/ArmSVE.h.inc"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#ifndef MLIR_DIALECT_LINALG_UTILS_UTILS_H
|
||||
#define MLIR_DIALECT_LINALG_UTILS_UTILS_H
|
||||
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
|
|
|
@ -14,7 +14,6 @@ include "mlir/Pass/PassBase.td"
|
|||
def ExpandOps : Pass<"memref-expand", "FuncOp"> {
|
||||
let summary = "Legalize memref operations to be convertible to LLVM.";
|
||||
let constructor = "mlir::memref::createExpandOpsPass()";
|
||||
let dependentDialects = ["func::FuncDialect"];
|
||||
}
|
||||
|
||||
def FoldSubViewOps : Pass<"fold-memref-subview-ops"> {
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#define DIALECT_TOSA_UTILS_COVERSION_UTILS_H_
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Tensor/IR/Tensor.h"
|
||||
#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
|
||||
#include "mlir/IR/PatternMatch.h"
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "../PassDetail.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Affine/Utils.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/Vector/IR/VectorOps.h"
|
||||
|
@ -553,9 +552,8 @@ class LowerAffinePass : public ConvertAffineToStandardBase<LowerAffinePass> {
|
|||
populateAffineToStdConversionPatterns(patterns);
|
||||
populateAffineToVectorConversionPatterns(patterns);
|
||||
ConversionTarget target(getContext());
|
||||
target.addLegalDialect<arith::ArithmeticDialect, func::FuncDialect,
|
||||
memref::MemRefDialect, scf::SCFDialect,
|
||||
VectorDialect>();
|
||||
target.addLegalDialect<arith::ArithmeticDialect, memref::MemRefDialect,
|
||||
scf::SCFDialect, VectorDialect>();
|
||||
if (failed(applyPartialConversion(getOperation(), target,
|
||||
std::move(patterns))))
|
||||
signalPassFailure();
|
||||
|
|
|
@ -14,7 +14,6 @@ add_mlir_conversion_library(MLIRAffineToStandard
|
|||
MLIRAffine
|
||||
MLIRAffineUtils
|
||||
MLIRArithmetic
|
||||
MLIRFunc
|
||||
MLIRIR
|
||||
MLIRMemRef
|
||||
MLIRSCF
|
||||
|
|
|
@ -12,7 +12,6 @@ add_mlir_conversion_library(MLIRComplexToLLVM
|
|||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRComplex
|
||||
MLIRFuncTransforms
|
||||
MLIRLLVMCommonConversion
|
||||
MLIRLLVMIR
|
||||
MLIRTransforms
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "mlir/Conversion/LLVMCommon/Pattern.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Complex/IR/Complex.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
|
||||
using namespace mlir;
|
||||
|
|
|
@ -10,7 +10,6 @@ add_mlir_conversion_library(MLIRComplexToStandard
|
|||
LINK_LIBS PUBLIC
|
||||
MLIRArithmetic
|
||||
MLIRComplex
|
||||
MLIRFunc
|
||||
MLIRIR
|
||||
MLIRMath
|
||||
MLIRTransforms
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "../PassDetail.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Complex/IR/Complex.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Math/IR/Math.h"
|
||||
#include "mlir/IR/ImplicitLocOpBuilder.h"
|
||||
#include "mlir/IR/PatternMatch.h"
|
||||
|
@ -652,8 +651,7 @@ void ConvertComplexToStandardPass::runOnOperation() {
|
|||
populateComplexToStandardConversionPatterns(patterns);
|
||||
|
||||
ConversionTarget target(getContext());
|
||||
target.addLegalDialect<arith::ArithmeticDialect, func::FuncDialect,
|
||||
math::MathDialect>();
|
||||
target.addLegalDialect<arith::ArithmeticDialect, math::MathDialect>();
|
||||
target.addLegalOp<complex::CreateOp, complex::ImOp, complex::ReOp>();
|
||||
if (failed(applyPartialConversion(function, target, std::move(patterns))))
|
||||
signalPassFailure();
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "GPUOpsLowering.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/IR/Builders.h"
|
||||
#include "llvm/Support/FormatVariadic.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#define MLIR_CONVERSION_GPUCOMMON_OPTOFUNCCALLLOWERING_H_
|
||||
|
||||
#include "mlir/Conversion/LLVMCommon/Pattern.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/GPU/GPUDialect.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/IR/Builders.h"
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h"
|
||||
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/ControlFlow/IR/ControlFlow.h"
|
||||
#include "mlir/Dialect/GPU/GPUDialect.h"
|
||||
#include "mlir/Dialect/GPU/Passes.h"
|
||||
#include "mlir/Dialect/LLVMIR/NVVMDialect.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Linalg/Utils/Utils.h"
|
||||
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
|
||||
|
|
|
@ -11,6 +11,7 @@ add_mlir_conversion_library(MLIRLinalgToStandard
|
|||
Core
|
||||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRFunc
|
||||
MLIRIR
|
||||
MLIRLinalg
|
||||
MLIRMemRef
|
||||
|
|
|
@ -13,8 +13,9 @@ add_mlir_conversion_library(MLIRMathToLibm
|
|||
LINK_LIBS PUBLIC
|
||||
MLIRArithmetic
|
||||
MLIRDialectUtils
|
||||
MLIRFuncTransforms
|
||||
MLIRFunc
|
||||
MLIRMath
|
||||
MLIRTransformUtils
|
||||
MLIRVector
|
||||
MLIRVectorUtils
|
||||
)
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "../PassDetail.h"
|
||||
#include "mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/OpenACC/OpenACC.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Transforms/DialectConversion.h"
|
||||
|
|
|
@ -13,7 +13,6 @@ add_mlir_conversion_library(MLIRSCFToGPU
|
|||
MLIRAffineToStandard
|
||||
MLIRArithmetic
|
||||
MLIRComplex
|
||||
MLIRFunc
|
||||
MLIRGPUTransforms
|
||||
MLIRIR
|
||||
MLIRLinalg
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/GPU/GPUDialect.h"
|
||||
#include "mlir/Dialect/GPU/ParallelLoopMapper.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Complex/IR/Complex.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/GPU/GPUDialect.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Transforms/DialectConversion.h"
|
||||
|
|
|
@ -13,7 +13,6 @@ add_mlir_conversion_library(MLIRSCFToOpenMP
|
|||
LINK_LIBS PUBLIC
|
||||
MLIRAnalysis
|
||||
MLIRArithmetic
|
||||
MLIRFunc
|
||||
MLIRLLVMIR
|
||||
MLIROpenMP
|
||||
MLIRSCF
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "mlir/Analysis/SliceAnalysis.h"
|
||||
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
|
||||
|
|
|
@ -14,7 +14,6 @@ add_mlir_conversion_library(MLIRSCFToSPIRV
|
|||
MLIRSPIRV
|
||||
MLIRSPIRVConversion
|
||||
MLIRStandardToSPIRV
|
||||
MLIRFunc
|
||||
MLIRIR
|
||||
MLIRPass
|
||||
MLIRSCF
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h"
|
||||
#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h"
|
||||
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/GPU/GPUDialect.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h"
|
||||
#include "mlir/Conversion/LLVMCommon/Pattern.h"
|
||||
#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
|
||||
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include "../PassDetail.h"
|
||||
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/Shape/IR/Shape.h"
|
||||
#include "mlir/Dialect/Tensor/IR/Tensor.h"
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include "../PassDetail.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/Shape/IR/Shape.h"
|
||||
#include "mlir/Dialect/Tensor/IR/Tensor.h"
|
||||
|
@ -668,8 +667,8 @@ void ConvertShapeToStandardPass::runOnOperation() {
|
|||
// Setup target legality.
|
||||
MLIRContext &ctx = getContext();
|
||||
ConversionTarget target(ctx);
|
||||
target.addLegalDialect<arith::ArithmeticDialect, func::FuncDialect,
|
||||
SCFDialect, tensor::TensorDialect>();
|
||||
target.addLegalDialect<arith::ArithmeticDialect, SCFDialect,
|
||||
tensor::TensorDialect>();
|
||||
target.addLegalOp<CstrRequireOp, FuncOp, ModuleOp>();
|
||||
|
||||
// Setup conversion patterns.
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "mlir/Conversion/TosaToLinalg/TosaToLinalg.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Math/IR/Math.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "mlir/Conversion/TosaToLinalg/TosaToLinalg.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Math/IR/Math.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "../PassDetail.h"
|
||||
#include "mlir/Conversion/TosaToLinalg/TosaToLinalg.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Math/IR/Math.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
|
@ -33,17 +32,16 @@ namespace {
|
|||
struct TosaToLinalgNamed : public TosaToLinalgNamedBase<TosaToLinalgNamed> {
|
||||
public:
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry.insert<arith::ArithmeticDialect, linalg::LinalgDialect,
|
||||
math::MathDialect, func::FuncDialect, tensor::TensorDialect,
|
||||
scf::SCFDialect>();
|
||||
registry
|
||||
.insert<arith::ArithmeticDialect, linalg::LinalgDialect,
|
||||
math::MathDialect, tensor::TensorDialect, scf::SCFDialect>();
|
||||
}
|
||||
|
||||
void runOnOperation() override {
|
||||
RewritePatternSet patterns(&getContext());
|
||||
ConversionTarget target(getContext());
|
||||
target.addLegalDialect<linalg::LinalgDialect, func::FuncDialect,
|
||||
tosa::TosaDialect, tensor::TensorDialect,
|
||||
scf::SCFDialect>();
|
||||
target.addLegalDialect<linalg::LinalgDialect, tosa::TosaDialect,
|
||||
tensor::TensorDialect, scf::SCFDialect>();
|
||||
|
||||
// Not every TOSA op can be legalized to linalg.
|
||||
target.addIllegalOp<tosa::Conv2DOp>();
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "../PassDetail.h"
|
||||
#include "mlir/Conversion/TosaToLinalg/TosaToLinalg.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Math/IR/Math.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
|
@ -34,16 +33,16 @@ namespace {
|
|||
struct TosaToLinalg : public TosaToLinalgBase<TosaToLinalg> {
|
||||
public:
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry.insert<arith::ArithmeticDialect, linalg::LinalgDialect,
|
||||
math::MathDialect, func::FuncDialect, tensor::TensorDialect,
|
||||
scf::SCFDialect>();
|
||||
registry
|
||||
.insert<arith::ArithmeticDialect, linalg::LinalgDialect,
|
||||
math::MathDialect, tensor::TensorDialect, scf::SCFDialect>();
|
||||
}
|
||||
|
||||
void runOnOperation() override {
|
||||
RewritePatternSet patterns(&getContext());
|
||||
ConversionTarget target(getContext());
|
||||
target.addLegalDialect<linalg::LinalgDialect, func::FuncDialect,
|
||||
tensor::TensorDialect, scf::SCFDialect>();
|
||||
target.addLegalDialect<linalg::LinalgDialect, tensor::TensorDialect,
|
||||
scf::SCFDialect>();
|
||||
target.addIllegalDialect<tosa::TosaDialect>();
|
||||
|
||||
// Not every TOSA op can be legalized to linalg.
|
||||
|
|
|
@ -11,7 +11,6 @@ add_mlir_conversion_library(MLIRTosaToSCF
|
|||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRIR
|
||||
MLIRFunc
|
||||
MLIRSCF
|
||||
MLIRPass
|
||||
MLIRTensor
|
||||
|
|
|
@ -11,7 +11,6 @@ add_mlir_conversion_library(MLIRTosaToStandard
|
|||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmetic
|
||||
MLIRFunc
|
||||
MLIRIR
|
||||
MLIRPass
|
||||
MLIRTosa
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "mlir/Conversion/TosaToStandard/TosaToStandard.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Tensor/IR/Tensor.h"
|
||||
#include "mlir/Dialect/Tosa/IR/TosaOps.h"
|
||||
#include "mlir/IR/PatternMatch.h"
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "../PassDetail.h"
|
||||
#include "mlir/Conversion/TosaToStandard/TosaToStandard.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Tensor/IR/Tensor.h"
|
||||
#include "mlir/Dialect/Tosa/IR/TosaOps.h"
|
||||
#include "mlir/Dialect/Tosa/Transforms/PassDetail.h"
|
||||
|
@ -36,7 +35,6 @@ public:
|
|||
target.addIllegalOp<tosa::SliceOp>();
|
||||
target.addIllegalOp<tosa::ApplyScaleOp>();
|
||||
target.addLegalDialect<arith::ArithmeticDialect>();
|
||||
target.addLegalDialect<func::FuncDialect>();
|
||||
target.addLegalDialect<tensor::TensorDialect>();
|
||||
|
||||
mlir::tosa::populateTosaToStandardConversionPatterns(&patterns);
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include "mlir/Conversion/LLVMCommon/VectorPattern.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/FunctionCallUtils.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
|
|
|
@ -88,7 +88,6 @@ void LowerVectorToLLVMPass::runOnOperation() {
|
|||
LLVMConversionTarget target(getContext());
|
||||
target.addLegalDialect<arith::ArithmeticDialect>();
|
||||
target.addLegalDialect<memref::MemRefDialect>();
|
||||
target.addLegalDialect<func::FuncDialect>();
|
||||
target.addLegalOp<UnrealizedConversionCastOp>();
|
||||
if (armNeon) {
|
||||
// TODO: we may or may not want to include in-dialect lowering to
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "mlir/Conversion/LLVMCommon/Pattern.h"
|
||||
#include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h"
|
||||
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/GPU/GPUDialect.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/Dialect/LLVMIR/ROCDLDialect.h"
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
|
||||
#include "mlir/Conversion/LLVMCommon/Pattern.h"
|
||||
#include "mlir/Dialect/AMX/AMXDialect.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/IR/BuiltinOps.h"
|
||||
#include "mlir/IR/PatternMatch.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/IR/AffineExprVisitor.h"
|
||||
#include "mlir/IR/BuiltinOps.h"
|
||||
#include "mlir/IR/IntegerSet.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/IR/AffineExprVisitor.h"
|
||||
#include "mlir/IR/IntegerSet.h"
|
||||
#include "mlir/Support/LLVM.h"
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include "mlir/Dialect/Affine/Analysis/NestedMatcher.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/IR/IntegerSet.h"
|
||||
#include "llvm/ADT/SmallPtrSet.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "mlir/Dialect/Affine/LoopUtils.h"
|
||||
#include "mlir/Dialect/Affine/Passes.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
|
||||
#include "llvm/ADT/MapVector.h"
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "mlir/IR/AffineExpr.h"
|
||||
#include "mlir/IR/AffineMap.h"
|
||||
#include "mlir/IR/Builders.h"
|
||||
#include "mlir/IR/Matchers.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/DenseSet.h"
|
||||
#include "llvm/ADT/SmallPtrSet.h"
|
||||
|
@ -82,7 +83,7 @@ bool isOpLoopInvariant(Operation &op, Value indVar, ValueRange iterArgs,
|
|||
} else if (isa<AffineDmaStartOp, AffineDmaWaitOp>(op)) {
|
||||
// TODO: Support DMA ops.
|
||||
return false;
|
||||
} else if (!isa<arith::ConstantOp, func::ConstantOp>(op)) {
|
||||
} else if (!matchPattern(&op, m_Constant())) {
|
||||
// Register op in the set of ops that have users.
|
||||
opsWithUsers.insert(&op);
|
||||
if (isa<AffineMapAccessInterface>(op)) {
|
||||
|
|
|
@ -26,7 +26,6 @@ add_mlir_dialect_library(MLIRAffineTransforms
|
|||
MLIRAffineAnalysis
|
||||
MLIRAffineUtils
|
||||
MLIRArithmetic
|
||||
MLIRFunc
|
||||
MLIRIR
|
||||
MLIRMemRef
|
||||
MLIRPass
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "PassDetail.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arithmetic/Transforms/Passes.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/IR/TypeUtilities.h"
|
||||
#include "mlir/Transforms/DialectConversion.h"
|
||||
|
||||
|
@ -197,7 +196,7 @@ struct ArithmeticExpandOpsPass
|
|||
|
||||
arith::populateArithmeticExpandOpsPatterns(patterns);
|
||||
|
||||
target.addLegalDialect<arith::ArithmeticDialect, func::FuncDialect>();
|
||||
target.addLegalDialect<arith::ArithmeticDialect>();
|
||||
// clang-format off
|
||||
target.addIllegalOp<
|
||||
arith::CeilDivSIOp,
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "mlir/Conversion/LLVMCommon/Pattern.h"
|
||||
#include "mlir/Dialect/ArmSVE/ArmSVEDialect.h"
|
||||
#include "mlir/Dialect/ArmSVE/Transforms.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/IR/BuiltinOps.h"
|
||||
#include "mlir/IR/PatternMatch.h"
|
||||
|
|
|
@ -69,7 +69,6 @@ add_mlir_dialect_library(MLIRGPUTransforms
|
|||
MLIRArithmetic
|
||||
MLIRAsync
|
||||
MLIRDataLayoutInterfaces
|
||||
MLIRFunc
|
||||
MLIRGPUOps
|
||||
MLIRIR
|
||||
MLIRLLVMIR
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
|
||||
#include "mlir/Dialect/DLTI/DLTI.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/GPU/GPUDialect.h"
|
||||
#include "mlir/Dialect/GPU/Passes.h"
|
||||
#include "mlir/Dialect/GPU/Utils.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/IR/BlockAndValueMapping.h"
|
||||
#include "mlir/IR/Builders.h"
|
||||
#include "mlir/IR/Matchers.h"
|
||||
#include "mlir/IR/SymbolTable.h"
|
||||
#include "mlir/Parser.h"
|
||||
#include "mlir/Support/LLVM.h"
|
||||
|
@ -60,8 +60,8 @@ static void injectGpuIndexOperations(Location loc, Region &launchFuncOpBody,
|
|||
/// operations may not have side-effects, as otherwise sinking (and hence
|
||||
/// duplicating them) is not legal.
|
||||
static bool isLikelyAnIndexComputation(Operation *op) {
|
||||
return isa<arith::ConstantOp, func::ConstantOp, memref::DimOp,
|
||||
arith::SelectOp, arith::CmpIOp>(op);
|
||||
return matchPattern(op, m_Constant()) ||
|
||||
isa<memref::DimOp, arith::SelectOp, arith::CmpIOp>(op);
|
||||
}
|
||||
|
||||
/// For a given operation `op`, computes whether it is beneficial to sink the
|
||||
|
|
|
@ -7,7 +7,6 @@ add_mlir_dialect_library(MLIRLinalgAnalysis
|
|||
LINK_LIBS PUBLIC
|
||||
MLIRAffineAnalysis
|
||||
MLIRAnalysis
|
||||
MLIRFunc
|
||||
MLIRIR
|
||||
MLIRLinalg
|
||||
MLIRMemRef
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h"
|
||||
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/IR/BuiltinOps.h"
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "mlir/Dialect/Arithmetic/Utils/Utils.h"
|
||||
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
|
||||
#include "mlir/Dialect/Bufferization/Transforms/Bufferize.h"
|
||||
#include "mlir/Dialect/Func/Transforms/Passes.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Linalg/Passes.h"
|
||||
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
|
||||
|
@ -180,8 +179,7 @@ struct LinalgBufferizePass : public LinalgBufferizeBase<LinalgBufferizePass> {
|
|||
|
||||
// Mark certain operations legal.
|
||||
target.addLegalDialect<arith::ArithmeticDialect, AffineDialect,
|
||||
func::FuncDialect, memref::MemRefDialect,
|
||||
tensor::TensorDialect>();
|
||||
memref::MemRefDialect, tensor::TensorDialect>();
|
||||
target.addIllegalOp<InitTensorOp>();
|
||||
|
||||
// Mark all Linalg operations illegal as long as they work on tensors.
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h"
|
||||
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
|
||||
#include "mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/ComprehensiveBufferize/AffineInterfaceImpl.h"
|
||||
#include "mlir/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.h"
|
||||
#include "mlir/Dialect/Linalg/Passes.h"
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include "PassDetail.h"
|
||||
#include "mlir/Dialect/Arithmetic/Utils/Utils.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
|
||||
#include "mlir/Dialect/Linalg/Utils/Utils.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "mlir/Dialect/Linalg/Transforms/HoistPadding.h"
|
||||
#include "mlir/Analysis/SliceAnalysis.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
|
@ -23,6 +22,7 @@
|
|||
#include "mlir/IR/AsmState.h"
|
||||
#include "mlir/IR/BuiltinOps.h"
|
||||
#include "mlir/IR/Dominance.h"
|
||||
#include "mlir/IR/Matchers.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
|
||||
|
@ -368,7 +368,7 @@ HoistingAnalysis::getPackedTensorSizes(ImplicitLocOpBuilder &b) {
|
|||
}
|
||||
|
||||
static bool isDefinedOutsideOrConstant(scf::ForOp outer, Value v) {
|
||||
return outer.isDefinedOutsideOfLoop(v) || v.getDefiningOp<func::ConstantOp>();
|
||||
return outer.isDefinedOutsideOfLoop(v) || matchPattern(v, m_Constant());
|
||||
}
|
||||
|
||||
/// Return the current iteration number in the loop (iv - lb).ceilDiv(step).
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "mlir/Analysis/SliceAnalysis.h"
|
||||
#include "mlir/Dialect/Affine/Analysis/AffineStructures.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "mlir/Analysis/SliceAnalysis.h"
|
||||
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
|
||||
|
|
|
@ -9,7 +9,6 @@ add_mlir_dialect_library(MLIRLinalgUtils
|
|||
MLIRAffineAnalysis
|
||||
MLIRAffineUtils
|
||||
MLIRArithmetic
|
||||
MLIRFunc
|
||||
MLIRIR
|
||||
MLIRLinalg
|
||||
MLIRSCF
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "mlir/Dialect/Affine/LoopUtils.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arithmetic/Utils/Utils.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
|
|
|
@ -8,8 +8,7 @@ add_mlir_dialect_library(MLIRMathTransforms
|
|||
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRArithmetic
|
||||
MLIRDialectUtils
|
||||
MLIRFunc
|
||||
MLIRDialectUtils
|
||||
MLIRIR
|
||||
MLIRMath
|
||||
MLIRPass
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Math/IR/Math.h"
|
||||
#include "mlir/Dialect/Math/Transforms/Passes.h"
|
||||
#include "mlir/IR/Builders.h"
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Arithmetic/Transforms/Passes.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Dialect/MemRef/Transforms/Passes.h"
|
||||
#include "mlir/IR/TypeUtilities.h"
|
||||
|
@ -128,8 +127,7 @@ struct ExpandOpsPass : public ExpandOpsBase<ExpandOpsPass> {
|
|||
memref::populateExpandOpsPatterns(patterns);
|
||||
ConversionTarget target(ctx);
|
||||
|
||||
target.addLegalDialect<arith::ArithmeticDialect, memref::MemRefDialect,
|
||||
func::FuncDialect>();
|
||||
target.addLegalDialect<arith::ArithmeticDialect, memref::MemRefDialect>();
|
||||
target.addDynamicallyLegalOp<memref::AtomicRMWOp>(
|
||||
[](memref::AtomicRMWOp op) {
|
||||
return op.kind() != arith::AtomicRMWKind::maxf &&
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "PassDetail.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Affine/Utils.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Dialect/MemRef/Transforms/Passes.h"
|
||||
#include "llvm/ADT/SmallSet.h"
|
||||
|
|
|
@ -10,7 +10,7 @@ add_mlir_dialect_library(MLIRSCF
|
|||
LINK_LIBS PUBLIC
|
||||
MLIRArithmetic
|
||||
MLIRBufferization
|
||||
MLIRFunc
|
||||
MLIRControlFlow
|
||||
MLIRIR
|
||||
MLIRLoopLikeInterface
|
||||
MLIRSideEffectInterfaces
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
|
||||
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/IR/BlockAndValueMapping.h"
|
||||
#include "mlir/IR/Matchers.h"
|
||||
#include "mlir/IR/PatternMatch.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "mlir/Dialect/Bufferization/Transforms/Bufferize.h"
|
||||
#include "PassDetail.h"
|
||||
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Dialect/SCF/Passes.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
|
|
|
@ -23,8 +23,7 @@ add_mlir_dialect_library(MLIRSCFTransforms
|
|||
MLIRArithmetic
|
||||
MLIRBufferization
|
||||
MLIRBufferizationTransforms
|
||||
MLIRDialectUtils
|
||||
MLIRFunc
|
||||
MLIRDialectUtils
|
||||
MLIRIR
|
||||
MLIRMemRef
|
||||
MLIRPass
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "PassDetail.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/SCF/Passes.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/SCF/Transforms.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "PassDetail.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/SCF/Transforms.h"
|
||||
#include "mlir/Dialect/SCF/Utils/Utils.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "PassDetail.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/SCF/Passes.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/SCF/Transforms.h"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "mlir/Dialect/Affine/Analysis/AffineStructures.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/SCF/Passes.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/SCF/Transforms.h"
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "PassDetail.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Dialect/SCF/Passes.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "PassDetail.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/SCF/Passes.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/SCF/Transforms.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "PassDetail.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/SCF/Passes.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/SCF/Transforms.h"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include "PassDetail.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Shape/IR/Shape.h"
|
||||
#include "mlir/Dialect/Shape/Transforms/Passes.h"
|
||||
#include "mlir/IR/Builders.h"
|
||||
|
@ -66,8 +65,7 @@ void ShapeToShapeLowering::runOnOperation() {
|
|||
populateShapeRewritePatterns(patterns);
|
||||
|
||||
ConversionTarget target(getContext());
|
||||
target.addLegalDialect<arith::ArithmeticDialect, func::FuncDialect,
|
||||
ShapeDialect>();
|
||||
target.addLegalDialect<arith::ArithmeticDialect, ShapeDialect>();
|
||||
target.addIllegalOp<NumElementsOp>();
|
||||
if (failed(mlir::applyPartialConversion(getOperation(), target,
|
||||
std::move(patterns))))
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Func/Transforms/FuncConversions.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h"
|
||||
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Linalg/Utils/Utils.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h"
|
||||
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/Tensor/IR/Tensor.h"
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Affine/LoopFusionUtils.h"
|
||||
#include "mlir/Dialect/Affine/LoopUtils.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Pass/Pass.h"
|
||||
|
||||
#define DEBUG_TYPE "test-loop-fusion"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/GPU/GPUDialect.h"
|
||||
#include "mlir/Dialect/GPU/MemoryPromotion.h"
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
|
@ -32,8 +31,7 @@ class TestGpuMemoryPromotionPass
|
|||
: public PassWrapper<TestGpuMemoryPromotionPass,
|
||||
OperationPass<gpu::GPUFuncOp>> {
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry.insert<AffineDialect, func::FuncDialect, memref::MemRefDialect,
|
||||
scf::SCFDialect>();
|
||||
registry.insert<AffineDialect, memref::MemRefDialect, scf::SCFDialect>();
|
||||
}
|
||||
StringRef getArgument() const final { return "test-gpu-memory-promotion"; }
|
||||
StringRef getDescription() const final {
|
||||
|
|
|
@ -16,8 +16,6 @@ add_mlir_library(MLIRLinalgTestPasses
|
|||
MLIRArithmeticTransforms
|
||||
MLIRBufferization
|
||||
MLIRBufferizationTransforms
|
||||
MLIRFunc
|
||||
MLIRFuncTransforms
|
||||
MLIRGPUTransforms
|
||||
MLIRLinalg
|
||||
MLIRLinalgTransforms
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include <utility>
|
||||
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/GPU/GPUDialect.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Linalg/Transforms/CodegenStrategy.h"
|
||||
|
@ -41,7 +40,6 @@ struct TestLinalgCodegenStrategy
|
|||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
// clang-format off
|
||||
registry.insert<AffineDialect,
|
||||
func::FuncDialect,
|
||||
gpu::GPUDialect,
|
||||
linalg::LinalgDialect,
|
||||
memref::MemRefDialect,
|
||||
|
|
|
@ -114,8 +114,8 @@ struct TestLinalgFusionTransforms
|
|||
: public PassWrapper<TestLinalgFusionTransforms<LoopType>,
|
||||
OperationPass<FuncOp>> {
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry.insert<AffineDialect, func::FuncDialect, linalg::LinalgDialect,
|
||||
memref::MemRefDialect, scf::SCFDialect>();
|
||||
registry.insert<AffineDialect, linalg::LinalgDialect, memref::MemRefDialect,
|
||||
scf::SCFDialect>();
|
||||
}
|
||||
TestLinalgFusionTransforms() = default;
|
||||
TestLinalgFusionTransforms(const TestLinalgFusionTransforms &pass) {}
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/GPU/GPUDialect.h"
|
||||
#include "mlir/Dialect/Linalg/IR/Linalg.h"
|
||||
#include "mlir/Dialect/Linalg/Passes.h"
|
||||
|
@ -39,7 +38,6 @@ struct TestLinalgTransforms
|
|||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
// clang-format off
|
||||
registry.insert<AffineDialect,
|
||||
func::FuncDialect,
|
||||
memref::MemRefDialect,
|
||||
scf::SCFDialect,
|
||||
linalg::LinalgDialect,
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/SCF/Utils/Utils.h"
|
||||
#include "mlir/IR/Builders.h"
|
||||
|
@ -49,7 +48,7 @@ public:
|
|||
}
|
||||
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry.insert<arith::ArithmeticDialect, func::FuncDialect>();
|
||||
registry.insert<arith::ArithmeticDialect>();
|
||||
}
|
||||
|
||||
void runOnOperation() override {
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
#include "mlir/Dialect/SCF/Transforms.h"
|
||||
#include "mlir/Dialect/SCF/Utils/Utils.h"
|
||||
|
@ -146,7 +145,7 @@ public:
|
|||
}
|
||||
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry.insert<arith::ArithmeticDialect, func::FuncDialect>();
|
||||
registry.insert<arith::ArithmeticDialect>();
|
||||
}
|
||||
|
||||
void runOnOperation() override {
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/Tensor/IR/Tensor.h"
|
||||
#include "mlir/Dialect/Tosa/IR/TosaOps.h"
|
||||
#include "mlir/Dialect/Tosa/Transforms/PassDetail.h"
|
||||
|
|
|
@ -3,6 +3,6 @@ add_mlir_unittest(MLIRPDLToPDLInterpTests
|
|||
)
|
||||
target_link_libraries(MLIRPDLToPDLInterpTests
|
||||
PRIVATE
|
||||
MLIRFunc
|
||||
MLIRArithmetic
|
||||
MLIRPDLToPDLInterp
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue