15#include "llvm/ADT/TypeSwitch.h"
17#include "mlir/Dialect/UB/IR/UBOpsDialect.cpp.inc"
25struct UBInlinerInterface :
public DialectInlinerInterface {
26 using DialectInlinerInterface::DialectInlinerInterface;
29 bool isLegalToInline(Operation *, Region *,
bool, IRMapping &)
const final {
39void 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 PoisonOp::create(builder, loc, type, attr);
60OpFoldResult 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"
68#include "mlir/Dialect/UB/IR/UBOps.cpp.inc"
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 class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
This class helps build Operations.
This class represents a single result from folding an operation.
Operation is the basic unit of execution within MLIR.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Include the generated interface declarations.