22#include "mlir/Dialect/Arith/IR/ArithOpsDialect.cpp.inc"
23#include "mlir/Dialect/Arith/IR/ArithOpsInterfaces.cpp.inc"
24#define GET_ATTRDEF_CLASSES
25#include "mlir/Dialect/Arith/IR/ArithOpsAttributes.cpp.inc"
30struct ArithInlinerInterface :
public DialectInlinerInterface {
31 using DialectInlinerInterface::DialectInlinerInterface;
40void arith::ArithDialect::initialize() {
41 addInterfaces<ArithInlinerInterface>();
42 declarePromisedInterface<ConvertToEmitCPatternInterface, ArithDialect>();
43 declarePromisedInterface<ConvertToLLVMPatternInterface, ArithDialect>();
44 declarePromisedInterface<bufferization::BufferDeallocationOpInterface,
46 declarePromisedInterfaces<bufferization::BufferizableOpInterface, ConstantOp,
47 IndexCastOp, SelectOp>();
48 declarePromisedInterfaces<ValueBoundsOpInterface, ConstantOp, ExtSIOp, AddIOp,
49 SubIOp, MulIOp, SelectOp, FloorDivSIOp, CeilDivSIOp,
50 MinSIOp, MaxSIOp, MinUIOp, MaxUIOp, RemSIOp,
51 RemUIOp, DivUIOp, DivSIOp>();
58 if (
auto poison = dyn_cast<ub::PoisonAttr>(value))
59 return ub::PoisonOp::create(builder, loc, type, poison);
61 return ConstantOp::materialize(builder, value, type, loc);
static bool isLegalToInline(InlinerInterface &interface, Region *src, Region *insertRegion, bool shouldCloneInlinedRegion, IRMapping &valueMapping)
Utility to check that all of the operations within 'src' can be inlined.
Attributes are known-constant values of operations.
This is a utility class for mapping one set of IR entities to another.
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
This class helps build Operations.
Operation is the basic unit of execution within MLIR.
This class contains a list of basic blocks and a link to the parent operation it is attached to.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Include the generated interface declarations.