17 #include "llvm/ADT/TypeSwitch.h"
18 #include "llvm/Support/Compiler.h"
26 LLVM_ATTRIBUTE_UNUSED
static LogicalResult
29 #define GET_TYPEDEF_CLASSES
30 #include "mlir/Dialect/Transform/IR/TransformTypes.cpp.inc"
32 void transform::TransformDialect::initializeTypes() {
34 #define GET_TYPEDEF_LIST
35 #include "mlir/Dialect/Transform/IR/TransformTypes.cpp.inc"
44 transform::AffineMapParamType::checkPayload(
Location loc,
47 if (!mlir::isa<AffineMapAttr>(attr)) {
48 return emitSilenceableError(loc)
49 <<
"expected affine map attribute, got " << attr;
60 transform::AnyOpType::checkPayload(
Location loc,
70 transform::AnyValueType::checkPayload(
Location loc,
80 transform::OperationType::checkPayload(
Location loc,
84 if (opName != op->getName()) {
86 emitSilenceableError(loc)
87 <<
"incompatible payload operation name expected " << opName <<
" vs "
88 << op->getName() <<
" -> " << *op;
89 diag.attachNote(op->getLoc()) <<
"payload operation";
102 transform::AnyParamType::checkPayload(
Location loc,
114 IntegerType intType = llvm::dyn_cast<IntegerType>(type);
115 if (!intType || intType.getWidth() > 64)
116 return emitError() <<
"only supports integer types with width <=64";
121 transform::ParamType::checkPayload(
Location loc,
124 auto integerAttr = llvm::dyn_cast<IntegerAttr>(attr);
126 return emitSilenceableError(loc)
127 <<
"expected parameter to be an integer attribute, got " << attr;
129 if (integerAttr.getType() !=
getType()) {
130 return emitSilenceableError(loc)
131 <<
"expected the type of the parameter attribute ("
132 << integerAttr.getType() <<
") to match the parameter type ("
144 transform::TypeParamType::checkPayload(
Location loc,
147 if (!mlir::isa<TypeAttr>(attr)) {
148 return emitSilenceableError(loc)
149 <<
"expected type attribute, got " << attr;
static std::string diag(const llvm::Value &value)
This base class exposes generic asm parser hooks, usable across the various derived parsers.
This base class exposes generic asm printer hooks, usable across the various derived printers.
Attributes are known-constant values of operations.
The result of a transform IR operation application.
static DiagnosedSilenceableFailure success()
Constructs a DiagnosedSilenceableFailure in the success state.
This class represents a diagnostic that is inflight and set to be reported.
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
MLIRContext * getContext() const
Return the context this location is uniqued in.
Operation is the basic unit of execution within MLIR.
This class implements Optional functionality for ParseResult.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Include the generated interface declarations.
Type getType(OpFoldResult ofr)
Returns the int type of the integer in ofr.
InFlightDiagnostic emitError(Location loc)
Utility method to emit an error message using this location.
LogicalResult verify(Operation *op, bool verifyRecursively=true)
Perform (potentially expensive) checks of invariants, used to detect compiler bugs,...