MLIR
20.0.0git
|
Once turned into IRDL verifiers, all constraints are attribute constraints. More...
#include "mlir/Dialect/IRDL/IRDLVerifiers.h"
Public Member Functions | |
virtual | ~Constraint ()=default |
virtual LogicalResult | verify (function_ref< InFlightDiagnostic()> emitError, Attribute attr, ConstraintVerifier &context) const =0 |
Check that an attribute is satisfying the constraint. More... | |
Once turned into IRDL verifiers, all constraints are attribute constraints.
Type constraints are represented as TypeAttr
attribute constraints to simplify verification. Verification that a type constraint must yield a TypeAttr
attribute happens before conversion, at the MLIR level.
Definition at line 71 of file IRDLVerifiers.h.
|
virtualdefault |
|
pure virtual |
Check that an attribute is satisfying the constraint.
Constraints may call other constraint verifiers. If that is the case, the constraint verifier will check if the variable is already assigned, and if so, check that the attribute is the same as the one assigned. If the variable is not assigned, the constraint verifier will assign the attribute to the variable, and check that the constraint is satisfied.
Implemented in mlir::irdl::AnyAttributeConstraint, mlir::irdl::AllOfConstraint, mlir::irdl::AnyOfConstraint, mlir::irdl::DynParametricTypeConstraint, mlir::irdl::DynParametricAttrConstraint, mlir::irdl::BaseTypeConstraint, mlir::irdl::BaseAttrConstraint, and mlir::irdl::IsConstraint.