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() {
43#include "mlir/Dialect/Arith/IR/ArithOps.cpp.inc"
46#define GET_ATTRDEF_LIST
47#include "mlir/Dialect/Arith/IR/ArithOpsAttributes.cpp.inc"
49 addInterfaces<ArithInlinerInterface>();
50 declarePromisedInterface<ConvertToEmitCPatternInterface, ArithDialect>();
51 declarePromisedInterface<ConvertToLLVMPatternInterface, ArithDialect>();
52 declarePromisedInterface<bufferization::BufferDeallocationOpInterface,
54 declarePromisedInterfaces<bufferization::BufferizableOpInterface, ConstantOp,
55 IndexCastOp, SelectOp>();
56 declarePromisedInterfaces<ValueBoundsOpInterface, ConstantOp, ExtSIOp, AddIOp,
57 SubIOp, MulIOp, SelectOp, FloorDivSIOp, CeilDivSIOp,
58 MinSIOp, MaxSIOp, MinUIOp, MaxUIOp, RemSIOp,
59 RemUIOp, DivUIOp, DivSIOp>();
66 if (
auto poison = dyn_cast<ub::PoisonAttr>(value))
67 return ub::PoisonOp::create(builder, loc, type, poison);
69 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.