15 #include "llvm/ADT/TypeSwitch.h"
17 #include "mlir/Dialect/UB/IR/UBOpsDialect.cpp.inc"
39 void UBDialect::initialize() {
42 #include "mlir/Dialect/UB/IR/UBOps.cpp.inc"
45 #define GET_ATTRDEF_LIST
46 #include "mlir/Dialect/UB/IR/UBOpsAttributes.cpp.inc"
48 addInterfaces<UBInlinerInterface>();
49 declarePromisedInterface<ConvertToLLVMPatternInterface, UBDialect>();
54 if (
auto attr = dyn_cast<PoisonAttr>(value))
55 return builder.
create<PoisonOp>(loc, type, attr);
60 OpFoldResult PoisonOp::fold(FoldAdaptor ) {
return getValue(); }
62 #include "mlir/Dialect/UB/IR/UBOpsInterfaces.cpp.inc"
64 #define GET_ATTRDEF_CLASSES
65 #include "mlir/Dialect/UB/IR/UBOpsAttributes.cpp.inc"
67 #define GET_OP_CLASSES
68 #include "mlir/Dialect/UB/IR/UBOps.cpp.inc"
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.
This class represents a single result from folding an operation.
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.