diff --git a/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td b/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td --- a/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td +++ b/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td @@ -269,7 +269,7 @@ DeclareOpInterfaceMethods] # traits> { } -def IRDL_Is : IRDL_ConstraintOp<"is", +def IRDL_IsOp : IRDL_ConstraintOp<"is", [ParentOneOf<["TypeOp", "AttributeOp", "OperationOp"]>, Pure]> { let summary = "Constraints an attribute/type to be a specific attribute instance"; let description = [{ @@ -296,7 +296,7 @@ let assemblyFormat = " $expected ` ` attr-dict "; } -def IRDL_Parametric : IRDL_ConstraintOp<"parametric", +def IRDL_ParametricOp : IRDL_ConstraintOp<"parametric", [ParentOneOf<["TypeOp", "AttributeOp", "OperationOp"]>, Pure]> { let summary = "Constraints an attribute/type base and its parameters"; let description = [{ @@ -331,7 +331,7 @@ let assemblyFormat = " $base_type `<` $args `>` ` ` attr-dict "; } -def IRDL_Any : IRDL_ConstraintOp<"any", +def IRDL_AnyOp : IRDL_ConstraintOp<"any", [ParentOneOf<["TypeOp", "AttributeOp", "OperationOp"]>]> { let summary = "Accept any type or attribute"; let description = [{ @@ -356,7 +356,7 @@ let assemblyFormat = " attr-dict "; } -def IRDL_AnyOf : IRDL_ConstraintOp<"any_of", +def IRDL_AnyOfOp : IRDL_ConstraintOp<"any_of", [ParentOneOf<["TypeOp", "AttributeOp", "OperationOp"]>, SameOperandsAndResultType]> { let summary = "Constraints to the union of the provided constraints"; @@ -389,7 +389,7 @@ let assemblyFormat = [{ `(` $args `)` ` ` attr-dict }]; } -def IRDL_AllOf : IRDL_ConstraintOp<"all_of", +def IRDL_AllOfOp : IRDL_ConstraintOp<"all_of", [ParentOneOf<["TypeOp", "AttributeOp", "OperationOp"]>, SameOperandsAndResultType]> { let summary = "Constraints to the intersection of the provided constraints"; diff --git a/mlir/lib/Dialect/IRDL/IR/IRDLOps.cpp b/mlir/lib/Dialect/IRDL/IR/IRDLOps.cpp --- a/mlir/lib/Dialect/IRDL/IR/IRDLOps.cpp +++ b/mlir/lib/Dialect/IRDL/IR/IRDLOps.cpp @@ -11,7 +11,7 @@ using namespace mlir; using namespace mlir::irdl; -std::unique_ptr Is::getVerifier( +std::unique_ptr IsOp::getVerifier( ArrayRef valueToConstr, DenseMap> const &types, DenseMap> const @@ -19,7 +19,7 @@ return std::make_unique(getExpectedAttr()); } -std::unique_ptr Parametric::getVerifier( +std::unique_ptr ParametricOp::getVerifier( ArrayRef valueToConstr, DenseMap> const &types, DenseMap> const @@ -55,7 +55,7 @@ "either a type or an attribute definition"); } -std::unique_ptr AnyOf::getVerifier( +std::unique_ptr AnyOfOp::getVerifier( ArrayRef valueToConstr, DenseMap> const &types, DenseMap> const @@ -73,7 +73,7 @@ return std::make_unique(constraints); } -std::unique_ptr AllOf::getVerifier( +std::unique_ptr AllOfOp::getVerifier( ArrayRef valueToConstr, DenseMap> const &types, DenseMap> const @@ -91,7 +91,7 @@ return std::make_unique(constraints); } -std::unique_ptr Any::getVerifier( +std::unique_ptr AnyOp::getVerifier( ArrayRef valueToConstr, DenseMap> const &types, DenseMap> const diff --git a/mlir/lib/Dialect/IRDL/IRDLLoading.cpp b/mlir/lib/Dialect/IRDL/IRDLLoading.cpp --- a/mlir/lib/Dialect/IRDL/IRDLLoading.cpp +++ b/mlir/lib/Dialect/IRDL/IRDLLoading.cpp @@ -252,7 +252,7 @@ SmallPtrSet ¶mIrdlOps, SmallPtrSet &isIds) { // For `irdl.any_of`, we get the bases from all its arguments. - if (auto anyOf = dyn_cast(op)) { + if (auto anyOf = dyn_cast(op)) { bool has_any = false; for (Value arg : anyOf.getArgs()) has_any &= getBases(arg.getDefiningOp(), paramIds, paramIrdlOps, isIds); @@ -261,12 +261,12 @@ // For `irdl.all_of`, we get the bases from the first argument. // This is restrictive, but we can relax it later if needed. - if (auto allOf = dyn_cast(op)) + if (auto allOf = dyn_cast(op)) return getBases(allOf.getArgs()[0].getDefiningOp(), paramIds, paramIrdlOps, isIds); // For `irdl.parametric`, we get directly the base from the operation. - if (auto params = dyn_cast(op)) { + if (auto params = dyn_cast(op)) { SymbolRefAttr symRef = params.getBaseType(); Operation *defOp = SymbolTable::lookupNearestSymbolFrom(op, symRef); assert(defOp && "symbol reference should refer to an existing operation"); @@ -275,7 +275,7 @@ } // For `irdl.is`, we get the base TypeID directly. - if (auto is = dyn_cast(op)) { + if (auto is = dyn_cast(op)) { Attribute expected = is.getExpected(); isIds.insert(expected.getTypeID()); return false; @@ -283,7 +283,7 @@ // For `irdl.any`, we return `false` since we can match any type or attribute // base. - if (auto isA = dyn_cast(op)) + if (auto isA = dyn_cast(op)) return true; llvm_unreachable("unknown IRDL constraint"); @@ -300,7 +300,7 @@ /// that they are disjoint between `parametric` and `is` operations. /// This restriction will be relaxed in the future, when we will change our /// algorithm to be non-greedy. -static LogicalResult checkCorrectAnyOf(AnyOf anyOf) { +static LogicalResult checkCorrectAnyOf(AnyOfOp anyOf) { SmallPtrSet paramIds; SmallPtrSet paramIrdlOps; SmallPtrSet isIds; @@ -404,8 +404,8 @@ LogicalResult mlir::irdl::loadDialects(ModuleOp op) { // First, check that all any_of constraints are in a correct form. // This is to ensure we can do the verification correctly. - WalkResult anyOfCorrects = - op.walk([](AnyOf anyOf) { return (WalkResult)checkCorrectAnyOf(anyOf); }); + WalkResult anyOfCorrects = op.walk( + [](AnyOfOp anyOf) { return (WalkResult)checkCorrectAnyOf(anyOf); }); if (anyOfCorrects.wasInterrupted()) return op.emitError("any_of constraints are not in the correct form");