forked from OSchip/llvm-project
[mlir] Finish replacing OwningRewritePatternList with RewritePatternSet
OwningRewritePatternList has been deprecated for ~10 months now, we can remove the leftover using directives at this point. Differential Revision: https://reviews.llvm.org/D118287
This commit is contained in:
parent
7d0426dd95
commit
9f85c198db
|
@ -3266,7 +3266,7 @@ public:
|
|||
|
||||
auto *context = getModule().getContext();
|
||||
fir::LLVMTypeConverter typeConverter{getModule()};
|
||||
mlir::OwningRewritePatternList pattern(context);
|
||||
mlir::RewritePatternSet pattern(context);
|
||||
pattern.insert<
|
||||
AbsentOpConversion, AddcOpConversion, AddrOfOpConversion,
|
||||
AllocaOpConversion, AllocMemOpConversion, BoxAddrOpConversion,
|
||||
|
|
|
@ -260,7 +260,7 @@ public:
|
|||
return !(embox.getShape() ||
|
||||
embox.getType().cast<BoxType>().getEleTy().isa<SequenceType>());
|
||||
});
|
||||
mlir::OwningRewritePatternList patterns(&context);
|
||||
mlir::RewritePatternSet patterns(&context);
|
||||
patterns.insert<EmboxConversion, ArrayCoorConversion, ReboxConversion>(
|
||||
&context);
|
||||
if (mlir::failed(
|
||||
|
|
|
@ -784,8 +784,8 @@ static mlir::LogicalResult verify(fir::ConstcOp &op) {
|
|||
// ConvertOp
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void fir::ConvertOp::getCanonicalizationPatterns(
|
||||
OwningRewritePatternList &results, MLIRContext *context) {
|
||||
void fir::ConvertOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<ConvertConvertOptPattern, RedundantConvertOptPattern,
|
||||
CombineConvertOptPattern, ForwardConstantConvertPattern>(
|
||||
context);
|
||||
|
@ -1508,7 +1508,7 @@ struct UndoComplexPattern : public mlir::RewritePattern {
|
|||
};
|
||||
|
||||
void fir::InsertValueOp::getCanonicalizationPatterns(
|
||||
mlir::OwningRewritePatternList &results, mlir::MLIRContext *context) {
|
||||
mlir::RewritePatternSet &results, mlir::MLIRContext *context) {
|
||||
results.insert<UndoComplexPattern<mlir::arith::AddFOp, fir::AddcOp>,
|
||||
UndoComplexPattern<mlir::arith::SubFOp, fir::SubcOp>>(context);
|
||||
}
|
||||
|
|
|
@ -216,7 +216,7 @@ public:
|
|||
auto *context = &getContext();
|
||||
auto func = getOperation();
|
||||
auto loc = func.getLoc();
|
||||
mlir::OwningRewritePatternList patterns(context);
|
||||
mlir::RewritePatternSet patterns(context);
|
||||
mlir::ConversionTarget target = *context;
|
||||
AbstractResultOptions options{passResultAsBox.getValue(),
|
||||
/*newArg=*/{}};
|
||||
|
|
|
@ -143,7 +143,7 @@ public:
|
|||
LLVM_DEBUG(llvm::dbgs() << "AffineDemotion: running on function:\n";
|
||||
function.print(llvm::dbgs()););
|
||||
|
||||
mlir::OwningRewritePatternList patterns(context);
|
||||
mlir::RewritePatternSet patterns(context);
|
||||
patterns.insert<ConvertConversion>(context);
|
||||
patterns.insert<AffineLoadConversion>(context);
|
||||
patterns.insert<AffineStoreConversion>(context);
|
||||
|
|
|
@ -587,7 +587,7 @@ public:
|
|||
auto function = getOperation();
|
||||
markAllAnalysesPreserved();
|
||||
auto functionAnalysis = AffineFunctionAnalysis(function);
|
||||
mlir::OwningRewritePatternList patterns(context);
|
||||
mlir::RewritePatternSet patterns(context);
|
||||
patterns.insert<AffineIfConversion>(context, functionAnalysis);
|
||||
patterns.insert<AffineLoopConversion>(context, functionAnalysis);
|
||||
mlir::ConversionTarget target = *context;
|
||||
|
|
|
@ -784,7 +784,7 @@ public:
|
|||
// array accesses are rewritten we can go on phase 2.
|
||||
// Phase 2 gets rid of the useless copy-in/copyout operations. The copy-in
|
||||
// /copy-out refers the Fortran copy-in/copy-out semantics on statements.
|
||||
mlir::OwningRewritePatternList patterns1(context);
|
||||
mlir::RewritePatternSet patterns1(context);
|
||||
patterns1.insert<ArrayFetchConversion>(context, useMap);
|
||||
patterns1.insert<ArrayUpdateConversion>(context, analysis, useMap);
|
||||
patterns1.insert<ArrayModifyConversion>(context, analysis, useMap);
|
||||
|
@ -801,7 +801,7 @@ public:
|
|||
signalPassFailure();
|
||||
}
|
||||
|
||||
mlir::OwningRewritePatternList patterns2(context);
|
||||
mlir::RewritePatternSet patterns2(context);
|
||||
patterns2.insert<ArrayLoadConversion>(context);
|
||||
patterns2.insert<ArrayMergeStoreConversion>(context);
|
||||
target.addIllegalOp<ArrayLoadOp, ArrayMergeStoreOp>();
|
||||
|
|
|
@ -101,7 +101,7 @@ public:
|
|||
if (clOpts.runtimeName.empty()) {
|
||||
auto *context = &getContext();
|
||||
auto *func = getOperation();
|
||||
mlir::OwningRewritePatternList patterns(context);
|
||||
mlir::RewritePatternSet patterns(context);
|
||||
patterns.insert<CharacterConvertConversion>(context);
|
||||
mlir::ConversionTarget target(*context);
|
||||
target.addLegalDialect<mlir::AffineDialect, fir::FIROpsDialect,
|
||||
|
|
|
@ -148,7 +148,7 @@ void ExternalNameConversionPass::runOnOperation() {
|
|||
auto op = getOperation();
|
||||
auto *context = &getContext();
|
||||
|
||||
mlir::OwningRewritePatternList patterns(context);
|
||||
mlir::RewritePatternSet patterns(context);
|
||||
patterns.insert<MangleNameOnCallOp, MangleNameOnCallOp, MangleNameOnFuncOp,
|
||||
MangleNameForCommonBlock, MangleNameOnAddrOfOp,
|
||||
MangleNameOnEmboxProcOp>(context);
|
||||
|
|
|
@ -172,7 +172,7 @@ public:
|
|||
void runOnOperation() override {
|
||||
auto *context = &getContext();
|
||||
auto func = getOperation();
|
||||
mlir::OwningRewritePatternList patterns(context);
|
||||
mlir::RewritePatternSet patterns(context);
|
||||
mlir::ConversionTarget target(*context);
|
||||
|
||||
useCommandLineOptions();
|
||||
|
|
|
@ -296,7 +296,7 @@ class CfgConversion : public CFGConversionBase<CfgConversion> {
|
|||
public:
|
||||
void runOnOperation() override {
|
||||
auto *context = &getContext();
|
||||
mlir::OwningRewritePatternList patterns(context);
|
||||
mlir::RewritePatternSet patterns(context);
|
||||
patterns.insert<CfgLoopConv, CfgIfConv, CfgIterWhileConv>(
|
||||
context, forceLoopToExecuteOnce);
|
||||
mlir::ConversionTarget target(*context);
|
||||
|
|
|
@ -25,7 +25,6 @@ class Value;
|
|||
class ValueRange;
|
||||
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
/// Emit code that computes the given affine expression using standard
|
||||
/// arithmetic operations applied to the provided dimension and symbol values.
|
||||
|
|
|
@ -20,7 +20,6 @@ class OperationPass;
|
|||
class MLIRContext;
|
||||
class TypeConverter;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
/// Create a pass to convert Async operations to the LLVM dialect.
|
||||
std::unique_ptr<OperationPass<ModuleOp>> createConvertAsyncToLLVMPass();
|
||||
|
|
|
@ -26,7 +26,6 @@ struct LogicalResult;
|
|||
class ModuleOp;
|
||||
class Operation;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
template <typename T>
|
||||
class OperationPass;
|
||||
|
@ -56,7 +55,7 @@ std::unique_ptr<OperationPass<ModuleOp>> createGpuToLLVMConversionPass();
|
|||
/// Collect a set of patterns to convert from the GPU dialect to LLVM and
|
||||
/// populate converter for gpu types.
|
||||
void populateGpuToLLVMConversionPatterns(LLVMTypeConverter &converter,
|
||||
OwningRewritePatternList &patterns,
|
||||
RewritePatternSet &patterns,
|
||||
StringRef gpuBinaryAnnotation = {});
|
||||
|
||||
} // namespace mlir
|
||||
|
|
|
@ -16,7 +16,6 @@ namespace mlir {
|
|||
class LLVMTypeConverter;
|
||||
class ConversionTarget;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
template <typename OpT>
|
||||
class OperationPass;
|
||||
|
|
|
@ -16,7 +16,6 @@ namespace mlir {
|
|||
class LLVMTypeConverter;
|
||||
class ConversionTarget;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
template <typename OpT>
|
||||
class OperationPass;
|
||||
|
|
|
@ -17,7 +17,6 @@ namespace mlir {
|
|||
class MLIRContext;
|
||||
class SPIRVTypeConverter;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
/// Appends to a pattern list additional patterns for translating Linalg ops to
|
||||
/// SPIR-V ops.
|
||||
|
|
|
@ -17,7 +17,6 @@ class ModuleOp;
|
|||
template <typename T>
|
||||
class OperationPass;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
/// Populate the given list with patterns that convert from OpenMP to LLVM.
|
||||
void populateOpenMPToLLVMConversionPatterns(LLVMTypeConverter &converter,
|
||||
|
|
|
@ -18,7 +18,6 @@ class MLIRContext;
|
|||
class Value;
|
||||
class Operation;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
namespace scf {
|
||||
class ForOp;
|
||||
|
|
|
@ -21,7 +21,6 @@ class Pass;
|
|||
class SPIRVTypeConverter;
|
||||
struct ScfToSPIRVContextImpl;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
struct ScfToSPIRVContext {
|
||||
ScfToSPIRVContext();
|
||||
|
|
|
@ -17,7 +17,6 @@ struct LogicalResult;
|
|||
class Pass;
|
||||
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
/// Collect a set of patterns to lower from scf.for, scf.if, and
|
||||
/// loop.terminator to CFG operations within the Standard dialect, in particular
|
||||
|
|
|
@ -18,7 +18,6 @@ class ModuleOp;
|
|||
template <typename T>
|
||||
class OperationPass;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
void populateShapeToStandardConversionPatterns(RewritePatternSet &patterns);
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ class ModuleOp;
|
|||
template <typename OpT>
|
||||
class OperationPass;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
/// Collect a set of patterns to convert from the GPU dialect to ROCDL.
|
||||
void populateVectorToROCDLConversionPatterns(LLVMTypeConverter &converter,
|
||||
|
|
|
@ -14,7 +14,6 @@ namespace mlir {
|
|||
class LLVMConversionTarget;
|
||||
class LLVMTypeConverter;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
/// Collect a set of patterns to lower AMX ops to ops that map to LLVM
|
||||
/// intrinsics.
|
||||
|
|
|
@ -14,7 +14,6 @@ namespace mlir {
|
|||
class LLVMConversionTarget;
|
||||
class LLVMTypeConverter;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
/// Collect a set of patterns to lower ArmSVE ops to ops that map to LLVM
|
||||
/// intrinsics.
|
||||
|
|
|
@ -1289,8 +1289,8 @@ LogicalResult peelAndCanonicalizeTiledLoop(RewriterBase &rewriter,
|
|||
/// global transformations, in a staged fashion:
|
||||
/// 1. the first stage consists of a list of FrozenRewritePatternSet. Each
|
||||
/// FrozenRewritePatternSet in this list is applied once, in order.
|
||||
/// 2. the second stage consists of a single OwningRewritePattern that is
|
||||
/// applied greedily until convergence.
|
||||
/// 2. the second stage consists of a single RewritePattern that is applied
|
||||
/// greedily until convergence.
|
||||
/// 3. the third stage consists of applying a lambda, generally used for
|
||||
/// non-local transformation effects. This allows creating custom fused
|
||||
/// transformations where patterns can be ordered and applied at a finer
|
||||
|
|
|
@ -16,11 +16,10 @@
|
|||
namespace mlir {
|
||||
class MLIRContext;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
namespace memref {
|
||||
|
||||
void populateComposeSubViewPatterns(OwningRewritePatternList &patterns,
|
||||
void populateComposeSubViewPatterns(RewritePatternSet &patterns,
|
||||
MLIRContext *context);
|
||||
|
||||
} // namespace memref
|
||||
|
|
|
@ -27,7 +27,6 @@ class Region;
|
|||
class RewriterBase;
|
||||
class TypeConverter;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
class Operation;
|
||||
class Value;
|
||||
class ValueRange;
|
||||
|
|
|
@ -25,7 +25,6 @@ class MLIRContext;
|
|||
class Operation;
|
||||
class TypeConverter;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
/// Add a pattern to the given pattern list to convert the operand and result
|
||||
/// types of a CallOp with the given type converter.
|
||||
|
|
|
@ -23,7 +23,6 @@ class GlobalCreator;
|
|||
} // namespace bufferization
|
||||
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
void populateStdBufferizePatterns(
|
||||
bufferization::BufferizeTypeConverter &typeConverter,
|
||||
|
|
|
@ -17,7 +17,6 @@ class BufferizeTypeConverter;
|
|||
} // namespace bufferization
|
||||
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
void populateTensorBufferizePatterns(
|
||||
bufferization::BufferizeTypeConverter &typeConverter,
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
namespace mlir {
|
||||
class MLIRContext;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
namespace vector {
|
||||
class VectorDialect;
|
||||
|
|
|
@ -18,8 +18,6 @@ class VectorTransferOpInterface;
|
|||
class RewritePatternSet;
|
||||
class RewriterBase;
|
||||
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
namespace scf {
|
||||
class IfOp;
|
||||
} // namespace scf
|
||||
|
|
|
@ -17,7 +17,6 @@ class ImplicitLocOpBuilder;
|
|||
class LLVMConversionTarget;
|
||||
class LLVMTypeConverter;
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
namespace x86vector {
|
||||
|
||||
|
|
|
@ -49,15 +49,13 @@ class Pattern;
|
|||
class Region;
|
||||
class ResultRange;
|
||||
class RewritePattern;
|
||||
class RewritePatternSet;
|
||||
class Type;
|
||||
class Value;
|
||||
class ValueRange;
|
||||
template <typename ValueRangeT>
|
||||
class ValueTypeRange;
|
||||
|
||||
class RewritePatternSet;
|
||||
using OwningRewritePatternList = RewritePatternSet;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// OperationName
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -848,7 +848,7 @@ mlir::createGpuToLLVMConversionPass() {
|
|||
}
|
||||
|
||||
void mlir::populateGpuToLLVMConversionPatterns(
|
||||
LLVMTypeConverter &converter, OwningRewritePatternList &patterns,
|
||||
LLVMTypeConverter &converter, RewritePatternSet &patterns,
|
||||
StringRef gpuBinaryAnnotation) {
|
||||
converter.addConversion(
|
||||
[context = &converter.getContext()](gpu::AsyncTokenType type) -> Type {
|
||||
|
|
|
@ -138,7 +138,7 @@ class LegalizeDataOpForLLVMTranslation : public ConvertOpToLLVMPattern<Op> {
|
|||
} // namespace
|
||||
|
||||
void mlir::populateOpenACCToLLVMConversionPatterns(
|
||||
LLVMTypeConverter &converter, OwningRewritePatternList &patterns) {
|
||||
LLVMTypeConverter &converter, RewritePatternSet &patterns) {
|
||||
patterns.add<LegalizeDataOpForLLVMTranslation<acc::DataOp>>(converter);
|
||||
patterns.add<LegalizeDataOpForLLVMTranslation<acc::EnterDataOp>>(converter);
|
||||
patterns.add<LegalizeDataOpForLLVMTranslation<acc::ExitDataOp>>(converter);
|
||||
|
|
|
@ -209,7 +209,7 @@ OpFoldResult arith::AddIOp::fold(ArrayRef<Attribute> operands) {
|
|||
}
|
||||
|
||||
void arith::AddIOp::getCanonicalizationPatterns(
|
||||
OwningRewritePatternList &patterns, MLIRContext *context) {
|
||||
RewritePatternSet &patterns, MLIRContext *context) {
|
||||
patterns.insert<AddIAddConstant, AddISubConstantRHS, AddISubConstantLHS>(
|
||||
context);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ OpFoldResult arith::SubIOp::fold(ArrayRef<Attribute> operands) {
|
|||
}
|
||||
|
||||
void arith::SubIOp::getCanonicalizationPatterns(
|
||||
OwningRewritePatternList &patterns, MLIRContext *context) {
|
||||
RewritePatternSet &patterns, MLIRContext *context) {
|
||||
patterns.insert<SubIRHSAddConstant, SubILHSAddConstant, SubIRHSSubConstantRHS,
|
||||
SubIRHSSubConstantLHS, SubILHSSubConstantRHS,
|
||||
SubILHSSubConstantLHS>(context);
|
||||
|
@ -567,7 +567,7 @@ OpFoldResult arith::XOrIOp::fold(ArrayRef<Attribute> operands) {
|
|||
}
|
||||
|
||||
void arith::XOrIOp::getCanonicalizationPatterns(
|
||||
OwningRewritePatternList &patterns, MLIRContext *context) {
|
||||
RewritePatternSet &patterns, MLIRContext *context) {
|
||||
patterns.insert<XOrINotCmpI>(context);
|
||||
}
|
||||
|
||||
|
@ -846,7 +846,7 @@ bool arith::ExtSIOp::areCastCompatible(TypeRange inputs, TypeRange outputs) {
|
|||
}
|
||||
|
||||
void arith::ExtSIOp::getCanonicalizationPatterns(
|
||||
OwningRewritePatternList &patterns, MLIRContext *context) {
|
||||
RewritePatternSet &patterns, MLIRContext *context) {
|
||||
patterns.insert<ExtSIOfExtUI>(context);
|
||||
}
|
||||
|
||||
|
@ -926,7 +926,7 @@ bool arith::TruncFOp::areCastCompatible(TypeRange inputs, TypeRange outputs) {
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void arith::AndIOp::getCanonicalizationPatterns(
|
||||
OwningRewritePatternList &patterns, MLIRContext *context) {
|
||||
RewritePatternSet &patterns, MLIRContext *context) {
|
||||
patterns.insert<AndOfExtUI, AndOfExtSI>(context);
|
||||
}
|
||||
|
||||
|
@ -935,7 +935,7 @@ void arith::AndIOp::getCanonicalizationPatterns(
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void arith::OrIOp::getCanonicalizationPatterns(
|
||||
OwningRewritePatternList &patterns, MLIRContext *context) {
|
||||
RewritePatternSet &patterns, MLIRContext *context) {
|
||||
patterns.insert<OrOfExtUI, OrOfExtSI>(context);
|
||||
}
|
||||
|
||||
|
@ -1074,7 +1074,7 @@ OpFoldResult arith::IndexCastOp::fold(ArrayRef<Attribute> operands) {
|
|||
}
|
||||
|
||||
void arith::IndexCastOp::getCanonicalizationPatterns(
|
||||
OwningRewritePatternList &patterns, MLIRContext *context) {
|
||||
RewritePatternSet &patterns, MLIRContext *context) {
|
||||
patterns.insert<IndexCastOfIndexCast, IndexCastOfExtSI>(context);
|
||||
}
|
||||
|
||||
|
@ -1123,7 +1123,7 @@ OpFoldResult arith::BitcastOp::fold(ArrayRef<Attribute> operands) {
|
|||
}
|
||||
|
||||
void arith::BitcastOp::getCanonicalizationPatterns(
|
||||
OwningRewritePatternList &patterns, MLIRContext *context) {
|
||||
RewritePatternSet &patterns, MLIRContext *context) {
|
||||
patterns.insert<BitcastOfBitcast>(context);
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ using ScalableMaskedDivFOpLowering =
|
|||
|
||||
/// Populate the given list with patterns that convert from ArmSVE to LLVM.
|
||||
void mlir::populateArmSVELegalizeForLLVMExportPatterns(
|
||||
LLVMTypeConverter &converter, OwningRewritePatternList &patterns) {
|
||||
LLVMTypeConverter &converter, RewritePatternSet &patterns) {
|
||||
// Populate conversion patterns
|
||||
|
||||
// clang-format off
|
||||
|
|
|
@ -102,7 +102,7 @@ struct SimplifyClones : public OpRewritePattern<CloneOp> {
|
|||
|
||||
} // namespace
|
||||
|
||||
void CloneOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void CloneOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<SimplifyClones>(context);
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ checkBufferizationResult(Operation *op, const BufferizationOptions &options) {
|
|||
LogicalResult bufferization::bufferizeOp(Operation *op,
|
||||
const BufferizationState &state) {
|
||||
// Bufferize the op and its nested ops.
|
||||
OwningRewritePatternList patterns(op->getContext());
|
||||
RewritePatternSet patterns(op->getContext());
|
||||
patterns.add<BufferizationPattern>(op->getContext(), state);
|
||||
if (failed(applyPatternsAndFoldGreedily(op, std::move(patterns))))
|
||||
return failure();
|
||||
|
|
|
@ -1753,7 +1753,7 @@ struct TiledLoopResultsFolder : public OpRewritePattern<linalg::TiledLoopOp> {
|
|||
};
|
||||
} // namespace
|
||||
|
||||
void TiledLoopOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void TiledLoopOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<TiledLoopInputsFolder, TiledLoopResultsFolder,
|
||||
DimOfTiledLoopInsOutsFolder<tensor::DimOp>,
|
||||
|
|
|
@ -128,6 +128,6 @@ struct ComposeSubViewOpPattern : public OpRewritePattern<memref::SubViewOp> {
|
|||
} // namespace
|
||||
|
||||
void mlir::memref::populateComposeSubViewPatterns(
|
||||
OwningRewritePatternList &patterns, MLIRContext *context) {
|
||||
RewritePatternSet &patterns, MLIRContext *context) {
|
||||
patterns.insert<ComposeSubViewOpPattern>(context);
|
||||
}
|
||||
|
|
|
@ -2537,7 +2537,7 @@ struct WhileUnusedArg : public OpRewritePattern<WhileOp> {
|
|||
};
|
||||
} // namespace
|
||||
|
||||
void WhileOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void WhileOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<WhileConditionTruth, WhileUnusedResult, WhileCmpCond,
|
||||
WhileUnusedArg>(context);
|
||||
|
|
|
@ -764,7 +764,7 @@ struct SelectToExtUI : public OpRewritePattern<SelectOp> {
|
|||
}
|
||||
};
|
||||
|
||||
void SelectOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void SelectOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<SelectI1Simplify, SelectToExtUI>(context);
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ struct ConcatOptimization : public OpRewritePattern<tosa::ConcatOp> {
|
|||
}
|
||||
};
|
||||
|
||||
void ConcatOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void ConcatOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<ConcatOptimization>(context);
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ struct ReshapeConstOptimization : public OpRewritePattern<tosa::ReshapeOp> {
|
|||
}
|
||||
};
|
||||
|
||||
void ReshapeOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void ReshapeOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<ReshapeReshapeOptimization>(context);
|
||||
results.insert<ReshapeConstOptimization>(context);
|
||||
|
@ -284,7 +284,7 @@ struct NoOpOptimization : public OpRewritePattern<tosa::TransposeOp> {
|
|||
}
|
||||
};
|
||||
|
||||
void TransposeOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void TransposeOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<ConstantTransposeOptimization>(context);
|
||||
results.insert<NoOpOptimization>(context);
|
||||
|
@ -322,7 +322,7 @@ struct AddZeroOptimization : public OpRewritePattern<tosa::AddOp> {
|
|||
}
|
||||
};
|
||||
|
||||
void AddOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void AddOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<AddZeroOptimization>(context);
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ struct MulOneOptimization : public OpRewritePattern<tosa::MulOp> {
|
|||
}
|
||||
};
|
||||
|
||||
void MulOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void MulOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<MulOneOptimization>(context);
|
||||
}
|
||||
|
@ -418,7 +418,7 @@ struct MaterializePadValue : public OpRewritePattern<tosa::PadOp> {
|
|||
}
|
||||
};
|
||||
|
||||
void PadOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void PadOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<MaterializePadValue>(context);
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ struct MaxPool2dIsNoOp : public OpRewritePattern<tosa::MaxPool2dOp> {
|
|||
}
|
||||
};
|
||||
|
||||
void MaxPool2dOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void MaxPool2dOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<MaxPool2dIsNoOp>(context);
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ struct ClampClampOptimization : public OpRewritePattern<tosa::ClampOp> {
|
|||
}
|
||||
};
|
||||
|
||||
void ClampOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
|
||||
void ClampOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||
MLIRContext *context) {
|
||||
results.insert<ClampIsNoOp>(context);
|
||||
results.insert<ClampClampOptimization>(context);
|
||||
|
|
|
@ -53,7 +53,7 @@ struct TestLinalgDistribution
|
|||
|
||||
void TestLinalgDistribution::runOnOperation() {
|
||||
auto funcOp = getOperation();
|
||||
OwningRewritePatternList distributeTiledLoopsPatterns(&getContext());
|
||||
RewritePatternSet distributeTiledLoopsPatterns(&getContext());
|
||||
populateLinalgDistributeTiledLoopPattern(
|
||||
distributeTiledLoopsPatterns, getDistributionOptions(),
|
||||
LinalgTransformationFilter(
|
||||
|
|
|
@ -34,7 +34,7 @@ void TestComposeSubViewPass::getDependentDialects(
|
|||
}
|
||||
|
||||
void TestComposeSubViewPass::runOnOperation() {
|
||||
OwningRewritePatternList patterns(&getContext());
|
||||
RewritePatternSet patterns(&getContext());
|
||||
memref::populateComposeSubViewPatterns(patterns, &getContext());
|
||||
(void)applyPatternsAndFoldGreedily(getOperation(), std::move(patterns));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue