20 #define GEN_PASS_DEF_ARITHBUFFERIZEPASS
21 #include "mlir/Dialect/Arith/Transforms/Passes.h.inc"
26 using namespace bufferization;
30 struct ArithBufferizePass
31 :
public arith::impl::ArithBufferizePassBase<ArithBufferizePass> {
32 using ArithBufferizePassBase::ArithBufferizePassBase;
34 ArithBufferizePass(uint64_t alignment = 0,
bool constantOpOnly =
false)
35 : constantOpOnly(constantOpOnly) {
36 this->alignment = alignment;
39 void runOnOperation()
override {
42 options.opFilter.allowOperation<arith::ConstantOp>();
44 options.opFilter.allowDialect<arith::ArithDialect>();
46 options.bufferAlignment = alignment;
53 registry.
insert<bufferization::BufferizationDialect, memref::MemRefDialect,
54 arith::ArithDialect>();
65 return std::make_unique<ArithBufferizePass>(alignment,
static llvm::ManagedStatic< PassManagerOptions > options
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
void registerBufferizableOpInterfaceExternalModels(DialectRegistry ®istry)
std::unique_ptr< Pass > createConstantBufferizePass(uint64_t alignment=0)
Create a pass to bufferize arith.constant ops.
LogicalResult bufferizeOp(Operation *op, const BufferizationOptions &options, BufferizationStatistics *statistics=nullptr)
Bufferize op and its nested ops that implement BufferizableOpInterface.
BufferizationOptions getPartialBufferizationOptions()
Return BufferizationOptions such that the bufferizeOp behaves like the old (deprecated) partial,...
Include the generated interface declarations.
bool failed(LogicalResult result)
Utility function that returns true if the provided LogicalResult corresponds to a failure value.
Options for BufferizableOpInterface-based bufferization.