18 #include "llvm/ADT/TypeSwitch.h"
23 #include "mlir/Dialect/Arith/IR/ArithOpsDialect.cpp.inc"
24 #include "mlir/Dialect/Arith/IR/ArithOpsInterfaces.cpp.inc"
25 #define GET_ATTRDEF_CLASSES
26 #include "mlir/Dialect/Arith/IR/ArithOpsAttributes.cpp.inc"
41 void arith::ArithDialect::initialize() {
44 #include "mlir/Dialect/Arith/IR/ArithOps.cpp.inc"
47 #define GET_ATTRDEF_LIST
48 #include "mlir/Dialect/Arith/IR/ArithOpsAttributes.cpp.inc"
50 addInterfaces<ArithInlinerInterface>();
51 declarePromisedInterface<ConvertToLLVMPatternInterface, ArithDialect>();
52 declarePromisedInterface<bufferization::BufferDeallocationOpInterface,
54 declarePromisedInterfaces<bufferization::BufferizableOpInterface, ConstantOp,
55 IndexCastOp, SelectOp>();
56 declarePromisedInterfaces<ValueBoundsOpInterface, AddIOp, ConstantOp, SubIOp,
64 if (
auto poison = dyn_cast<ub::PoisonAttr>(value))
65 return builder.
create<ub::PoisonOp>(loc, type, poison);
67 return ConstantOp::materialize(builder, value, type, loc);
static Operation * materializeConstant(Dialect *dialect, OpBuilder &builder, Attribute value, Type type, Location loc)
A utility function used to materialize a constant for a given attribute and type.
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 the interface that must be implemented by the dialects of operations to be inlined.
DialectInlinerInterface(Dialect *dialect)
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 * create(const OperationState &state)
Creates an operation given the fields represented as an OperationState.
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.