[Mlir-commits] [mlir] 648d192 - Revert "[mlir][irdl] Add verification of IRDL ops"

Mathieu Fehr llvmlistbot at llvm.org
Fri May 12 10:48:13 PDT 2023


Author: Mathieu Fehr
Date: 2023-05-12T19:48:00+01:00
New Revision: 648d1920404566d66cef72cd378c755f09d93d0e

URL: https://github.com/llvm/llvm-project/commit/648d1920404566d66cef72cd378c755f09d93d0e
DIFF: https://github.com/llvm/llvm-project/commit/648d1920404566d66cef72cd378c755f09d93d0e.diff

LOG: Revert "[mlir][irdl] Add verification of IRDL ops"

This reverts commit 52761cb99164acd4ea76f91fc16a3e40ec94b898.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/IRDL/IR/CMakeLists.txt
    mlir/include/mlir/Dialect/IRDL/IR/IRDL.h
    mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
    mlir/lib/Dialect/IRDL/CMakeLists.txt
    mlir/lib/Dialect/IRDL/IR/IRDL.cpp
    mlir/lib/Dialect/IRDL/IRDLLoading.cpp
    mlir/test/Dialect/IRDL/testd.mlir

Removed: 
    mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.h
    mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.td
    mlir/lib/Dialect/IRDL/IR/IRDLOps.cpp


################################################################################
diff  --git a/mlir/include/mlir/Dialect/IRDL/IR/CMakeLists.txt b/mlir/include/mlir/Dialect/IRDL/IR/CMakeLists.txt
index 1a408834bc305..e165bd72d3b9d 100644
--- a/mlir/include/mlir/Dialect/IRDL/IR/CMakeLists.txt
+++ b/mlir/include/mlir/Dialect/IRDL/IR/CMakeLists.txt
@@ -1,12 +1,5 @@
 add_mlir_dialect(IRDL irdl)
 
-# Add IRDL interfaces
-set(LLVM_TARGET_DEFINITIONS IRDLInterfaces.td)
-mlir_tablegen(IRDLInterfaces.h.inc -gen-op-interface-decls)
-mlir_tablegen(IRDLInterfaces.cpp.inc -gen-op-interface-defs)
-add_public_tablegen_target(MLIRIRDLInterfacesIncGen)
-add_dependencies(mlir-generic-headers MLIRIRDLInterfacesIncGen)
-
 # Add IRDL operations
 set(LLVM_TARGET_DEFINITIONS IRDLOps.td)
 mlir_tablegen(IRDLOps.h.inc -gen-op-decls)

diff  --git a/mlir/include/mlir/Dialect/IRDL/IR/IRDL.h b/mlir/include/mlir/Dialect/IRDL/IR/IRDL.h
index 1b32691c00b84..c22f5e28d91c8 100644
--- a/mlir/include/mlir/Dialect/IRDL/IR/IRDL.h
+++ b/mlir/include/mlir/Dialect/IRDL/IR/IRDL.h
@@ -13,7 +13,6 @@
 #ifndef MLIR_DIALECT_IRDL_IR_IRDL_H_
 #define MLIR_DIALECT_IRDL_IR_IRDL_H_
 
-#include "mlir/Dialect/IRDL/IR/IRDLInterfaces.h"
 #include "mlir/Dialect/IRDL/IR/IRDLTraits.h"
 #include "mlir/IR/SymbolTable.h"
 #include "mlir/Interfaces/InferTypeOpInterface.h"

diff  --git a/mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.h b/mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.h
deleted file mode 100644
index 64553851ec1c4..0000000000000
--- a/mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===- IRDLInterfaces.h - IRDL interfaces definition ------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the interfaces used by the IRDL dialect.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef MLIR_DIALECT_IRDL_IR_IRDLINTERFACES_H_
-#define MLIR_DIALECT_IRDL_IR_IRDLINTERFACES_H_
-
-#include "mlir/Dialect/IRDL/IRDLVerifiers.h"
-#include "mlir/IR/BuiltinAttributes.h"
-#include "mlir/IR/Diagnostics.h"
-#include "mlir/IR/ExtensibleDialect.h"
-#include "mlir/IR/OpImplementation.h"
-#include "mlir/IR/Types.h"
-#include "mlir/Support/LogicalResult.h"
-#include <optional>
-
-namespace mlir {
-namespace irdl {
-class TypeOp;
-class AttributeOp;
-} // namespace irdl
-} // namespace mlir
-
-//===----------------------------------------------------------------------===//
-// IRDL Dialect Interfaces
-//===----------------------------------------------------------------------===//
-
-#include "mlir/Dialect/IRDL/IR/IRDLInterfaces.h.inc"
-
-#endif //  MLIR_DIALECT_IRDL_IR_IRDLINTERFACES_H_

diff  --git a/mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.td b/mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.td
deleted file mode 100644
index 0e45711ae441c..0000000000000
--- a/mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.td
+++ /dev/null
@@ -1,40 +0,0 @@
-//===- IRDLInterfaces.td - IRDL Attributes -----------------*- tablegen -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the interfaces used by IRDL.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef MLIR_DIALECT_IRDL_IR_IRDLINTERFACES
-#define MLIR_DIALECT_IRDL_IR_IRDLINTERFACES
-
-include "mlir/IR/OpBase.td"
-
-def VerifyConstraintInterface : OpInterface<"VerifyConstraintInterface"> {
-  let cppNamespace = "::mlir::irdl";
-
-  let description = [{
-    Interface to get an IRDL constraint verifier from an operation. 
-  }];
-
-  let methods = [
-    InterfaceMethod<
-      [{
-        Get an instance of a constraint verifier for the associated operation."
-        Returns `nullptr` upon failure.
-      }],
-      "std::unique_ptr<::mlir::irdl::Constraint>",
-      "getVerifier",
-      (ins "::mlir::SmallVector<Value> const&":$valueRes,
-      "::mlir::DenseMap<::mlir::irdl::TypeOp, std::unique_ptr<::mlir::DynamicTypeDefinition>> &":$types,
-      "::mlir::DenseMap<::mlir::irdl::AttributeOp, std::unique_ptr<::mlir::DynamicAttrDefinition>> &":$attrs)
-    >
-  ];
-}
-
-#endif // MLIR_DIALECT_IRDL_IR_IRDLINTERFACES

diff  --git a/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td b/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
index 5cce6858be2c6..59d152440b26e 100644
--- a/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
+++ b/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
@@ -15,7 +15,6 @@
 
 include "IRDL.td"
 include "IRDLTypes.td"
-include "IRDLInterfaces.td"
 include "mlir/Interfaces/SideEffectInterfaces.td"
 include "mlir/Interfaces/InferTypeOpInterface.td"
 include "mlir/IR/SymbolInterfaces.td"
@@ -265,8 +264,7 @@ def IRDL_ResultsOp : IRDL_Op<"results", [HasParent<"OperationOp">]> {
 //===----------------------------------------------------------------------===//
 
 class IRDL_ConstraintOp<string mnemonic, list<Trait> traits = []>
-    : IRDL_Op<mnemonic, [VerifyConstraintInterface,
-        DeclareOpInterfaceMethods<VerifyConstraintInterface>] # traits> {
+    : IRDL_Op<mnemonic, traits> {
 }
 
 def IRDL_Is : IRDL_ConstraintOp<"is",

diff  --git a/mlir/lib/Dialect/IRDL/CMakeLists.txt b/mlir/lib/Dialect/IRDL/CMakeLists.txt
index d25760e5d29bc..7af0e42293573 100644
--- a/mlir/lib/Dialect/IRDL/CMakeLists.txt
+++ b/mlir/lib/Dialect/IRDL/CMakeLists.txt
@@ -1,6 +1,5 @@
 add_mlir_dialect_library(MLIRIRDL
   IR/IRDL.cpp
-  IR/IRDLOps.cpp
   IRDLLoading.cpp
   IRDLVerifiers.cpp
 

diff  --git a/mlir/lib/Dialect/IRDL/IR/IRDL.cpp b/mlir/lib/Dialect/IRDL/IR/IRDL.cpp
index 01e58ccf0a5bd..e2649f22094c7 100644
--- a/mlir/lib/Dialect/IRDL/IR/IRDL.cpp
+++ b/mlir/lib/Dialect/IRDL/IR/IRDL.cpp
@@ -71,8 +71,6 @@ LogicalResult DialectOp::verify() {
   return success();
 }
 
-#include "mlir/Dialect/IRDL/IR/IRDLInterfaces.cpp.inc"
-
 #define GET_TYPEDEF_CLASSES
 #include "mlir/Dialect/IRDL/IR/IRDLTypesGen.cpp.inc"
 

diff  --git a/mlir/lib/Dialect/IRDL/IR/IRDLOps.cpp b/mlir/lib/Dialect/IRDL/IR/IRDLOps.cpp
deleted file mode 100644
index a9956cc630ccf..0000000000000
--- a/mlir/lib/Dialect/IRDL/IR/IRDLOps.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===- IRDLOps.cpp - IRDL dialect -------------------------------*- C++ -*-===//
-//
-// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "mlir/Dialect/IRDL/IR/IRDL.h"
-
-using namespace mlir;
-using namespace mlir::irdl;
-
-std::unique_ptr<Constraint> Is::getVerifier(
-    SmallVector<Value> const &valueToConstr,
-    DenseMap<TypeOp, std::unique_ptr<DynamicTypeDefinition>> &types,
-    DenseMap<AttributeOp, std::unique_ptr<DynamicAttrDefinition>> &attrs) {
-  return std::make_unique<IsConstraint>(getExpectedAttr());
-}
-
-std::unique_ptr<Constraint> Parametric::getVerifier(
-    SmallVector<Value> const &valueToConstr,
-    DenseMap<TypeOp, std::unique_ptr<DynamicTypeDefinition>> &types,
-    DenseMap<AttributeOp, std::unique_ptr<DynamicAttrDefinition>> &attrs) {
-  SmallVector<unsigned> constraints;
-  for (Value arg : getArgs()) {
-    for (auto [i, value] : enumerate(valueToConstr)) {
-      if (value == arg) {
-        constraints.push_back(i);
-        break;
-      }
-    }
-  }
-
-  // Symbol reference case for the base
-  SymbolRefAttr symRef = getBaseType();
-  Operation *defOp =
-      SymbolTable::lookupNearestSymbolFrom(getOperation(), symRef);
-  if (!defOp) {
-    emitError() << symRef << " does not refer to any existing symbol";
-    return nullptr;
-  }
-
-  if (auto typeOp = dyn_cast<TypeOp>(defOp))
-    return std::make_unique<DynParametricTypeConstraint>(types[typeOp].get(),
-                                                         constraints);
-
-  if (auto attrOp = dyn_cast<AttributeOp>(defOp))
-    return std::make_unique<DynParametricAttrConstraint>(attrs[attrOp].get(),
-                                                         constraints);
-
-  llvm_unreachable("verifier should ensure that the referenced operation is "
-                   "either a type or an attribute definition");
-}
-
-std::unique_ptr<Constraint> Any::getVerifier(
-    SmallVector<Value> const &valueToConstr,
-    DenseMap<TypeOp, std::unique_ptr<DynamicTypeDefinition>> &types,
-    DenseMap<AttributeOp, std::unique_ptr<DynamicAttrDefinition>> &attrs) {
-  return std::make_unique<AnyAttributeConstraint>();
-}

diff  --git a/mlir/lib/Dialect/IRDL/IRDLLoading.cpp b/mlir/lib/Dialect/IRDL/IRDLLoading.cpp
index b4b6f01466f3e..fb00085a7ee07 100644
--- a/mlir/lib/Dialect/IRDL/IRDLLoading.cpp
+++ b/mlir/lib/Dialect/IRDL/IRDLLoading.cpp
@@ -12,7 +12,6 @@
 
 #include "mlir/Dialect/IRDL/IRDLLoading.h"
 #include "mlir/Dialect/IRDL/IR/IRDL.h"
-#include "mlir/Dialect/IRDL/IR/IRDLInterfaces.h"
 #include "mlir/IR/BuiltinOps.h"
 #include "mlir/IR/ExtensibleDialect.h"
 #include "mlir/Support/LogicalResult.h"
@@ -23,130 +22,9 @@
 using namespace mlir;
 using namespace mlir::irdl;
 
-/// Verify that the given list of parameters satisfy the given constraints.
-/// This encodes the logic of the verification method for attributes and types
-/// defined with IRDL.
-static LogicalResult
-irdlAttrOrTypeVerifier(function_ref<InFlightDiagnostic()> emitError,
-                       ArrayRef<Attribute> params,
-                       ArrayRef<std::unique_ptr<Constraint>> constraints,
-                       ArrayRef<size_t> paramConstraints) {
-  if (params.size() != paramConstraints.size()) {
-    emitError() << "expected " << paramConstraints.size()
-                << " type arguments, but had " << params.size();
-    return failure();
-  }
-
-  ConstraintVerifier verifier(constraints);
-
-  // Check that each parameter satisfies its constraint.
-  for (auto [i, param] : enumerate(params))
-    if (failed(verifier.verify(emitError, param, paramConstraints[i])))
-      return failure();
-
-  return success();
-}
-
-/// Verify that the given operation satisfies the given constraints.
-/// This encodes the logic of the verification method for operations defined
-/// with IRDL.
-static LogicalResult
-irdlOpVerifier(Operation *op, ArrayRef<std::unique_ptr<Constraint>> constraints,
-               ArrayRef<size_t> operandConstrs,
-               ArrayRef<size_t> resultConstrs) {
-  /// Check that we have the right number of operands.
-  unsigned numOperands = op->getNumOperands();
-  size_t numExpectedOperands = operandConstrs.size();
-  if (numOperands != numExpectedOperands)
-    return op->emitOpError() << numExpectedOperands
-                             << " operands expected, but got " << numOperands;
-
-  /// Check that we have the right number of results.
-  unsigned numResults = op->getNumResults();
-  size_t numExpectedResults = resultConstrs.size();
-  if (numResults != numExpectedResults)
-    return op->emitOpError()
-           << numExpectedResults << " results expected, but got " << numResults;
-
-  auto emitError = [op]() { return op->emitError(); };
-
-  ConstraintVerifier verifier(constraints);
-
-  /// Check that all operands satisfy the constraints.
-  for (auto [i, operandType] : enumerate(op->getOperandTypes()))
-    if (failed(verifier.verify({emitError}, TypeAttr::get(operandType),
-                               operandConstrs[i])))
-      return failure();
-
-  /// Check that all results satisfy the constraints.
-  for (auto [i, resultType] : enumerate(op->getResultTypes()))
-    if (failed(verifier.verify({emitError}, TypeAttr::get(resultType),
-                               resultConstrs[i])))
-      return failure();
-
-  return success();
-}
-
 /// Define and load an operation represented by a `irdl.operation`
 /// operation.
-static WalkResult loadOperation(
-    OperationOp op, ExtensibleDialect *dialect,
-    DenseMap<TypeOp, std::unique_ptr<DynamicTypeDefinition>> &types,
-    DenseMap<AttributeOp, std::unique_ptr<DynamicAttrDefinition>> &attrs) {
-  // Resolve SSA values to verifier constraint slots
-  SmallVector<Value> constrToValue;
-  for (Operation &op : op->getRegion(0).getOps()) {
-    if (isa<VerifyConstraintInterface>(op)) {
-      if (op.getNumResults() != 1)
-        return op.emitError()
-               << "IRDL constraint operations must have exactly one result";
-      constrToValue.push_back(op.getResult(0));
-    }
-  }
-
-  // Build the verifiers for each constraint slot
-  SmallVector<std::unique_ptr<Constraint>> constraints;
-  for (Value v : constrToValue) {
-    VerifyConstraintInterface op =
-        cast<VerifyConstraintInterface>(v.getDefiningOp());
-    std::unique_ptr<Constraint> verifier =
-        op.getVerifier(constrToValue, types, attrs);
-    if (!verifier)
-      return WalkResult::interrupt();
-    constraints.push_back(std::move(verifier));
-  }
-
-  SmallVector<size_t> operandConstraints;
-  SmallVector<size_t> resultConstraints;
-
-  // Gather which constraint slots correspond to operand constraints
-  auto operandsOp = op.getOp<OperandsOp>();
-  if (operandsOp.has_value()) {
-    operandConstraints.reserve(operandsOp->getArgs().size());
-    for (Value operand : operandsOp->getArgs()) {
-      for (auto [i, constr] : enumerate(constrToValue)) {
-        if (constr == operand) {
-          operandConstraints.push_back(i);
-          break;
-        }
-      }
-    }
-  }
-
-  // Gather which constraint slots correspond to result constraints
-  auto resultsOp = op.getOp<ResultsOp>();
-  if (resultsOp.has_value()) {
-    resultConstraints.reserve(resultsOp->getArgs().size());
-    for (Value result : resultsOp->getArgs()) {
-      for (auto [i, constr] : enumerate(constrToValue)) {
-        if (constr == result) {
-          resultConstraints.push_back(i);
-          break;
-        }
-      }
-    }
-  }
-
+static WalkResult loadOperation(OperationOp op, ExtensibleDialect *dialect) {
   // IRDL does not support defining custom parsers or printers.
   auto parser = [](OpAsmParser &parser, OperationState &result) {
     return failure();
@@ -155,13 +33,7 @@ static WalkResult loadOperation(
     printer.printGenericOp(op);
   };
 
-  auto verifier =
-      [constraints{std::move(constraints)},
-       operandConstraints{std::move(operandConstraints)},
-       resultConstraints{std::move(resultConstraints)}](Operation *op) {
-        return irdlOpVerifier(op, constraints, operandConstraints,
-                              resultConstraints);
-      };
+  auto verifier = [](Operation *op) { return success(); };
 
   // IRDL does not support defining regions.
   auto regionVerifier = [](Operation *op) { return success(); };
@@ -174,68 +46,6 @@ static WalkResult loadOperation(
   return WalkResult::advance();
 }
 
-/// Get the verifier of a type or attribute definition.
-/// Return nullptr if the definition is invalid.
-static DynamicAttrDefinition::VerifierFn getAttrOrTypeVerifier(
-    Operation *attrOrTypeDef, ExtensibleDialect *dialect,
-    DenseMap<TypeOp, std::unique_ptr<DynamicTypeDefinition>> &types,
-    DenseMap<AttributeOp, std::unique_ptr<DynamicAttrDefinition>> &attrs) {
-  assert((isa<AttributeOp>(attrOrTypeDef) || isa<TypeOp>(attrOrTypeDef)) &&
-         "Expected an attribute or type definition");
-
-  // Resolve SSA values to verifier constraint slots
-  SmallVector<Value> constrToValue;
-  for (Operation &op : attrOrTypeDef->getRegion(0).getOps()) {
-    if (isa<VerifyConstraintInterface>(op)) {
-      assert(op.getNumResults() == 1 &&
-             "IRDL constraint operations must have exactly one result");
-      constrToValue.push_back(op.getResult(0));
-    }
-  }
-
-  // Build the verifiers for each constraint slot
-  SmallVector<std::unique_ptr<Constraint>> constraints;
-  for (Value v : constrToValue) {
-    VerifyConstraintInterface op =
-        cast<VerifyConstraintInterface>(v.getDefiningOp());
-    std::unique_ptr<Constraint> verifier =
-        op.getVerifier(constrToValue, types, attrs);
-    if (!verifier)
-      return {};
-    constraints.push_back(std::move(verifier));
-  }
-
-  // Get the parameter definitions.
-  std::optional<ParametersOp> params;
-  if (auto attr = dyn_cast<AttributeOp>(attrOrTypeDef))
-    params = attr.getOp<ParametersOp>();
-  else if (auto type = dyn_cast<TypeOp>(attrOrTypeDef))
-    params = type.getOp<ParametersOp>();
-
-  // Gather which constraint slots correspond to parameter constraints
-  SmallVector<size_t> paramConstraints;
-  if (params.has_value()) {
-    paramConstraints.reserve(params->getArgs().size());
-    for (Value param : params->getArgs()) {
-      for (auto [i, constr] : enumerate(constrToValue)) {
-        if (constr == param) {
-          paramConstraints.push_back(i);
-          break;
-        }
-      }
-    }
-  }
-
-  auto verifier = [paramConstraints{std::move(paramConstraints)},
-                   constraints{std::move(constraints)}](
-                      function_ref<InFlightDiagnostic()> emitError,
-                      ArrayRef<Attribute> params) {
-    return irdlAttrOrTypeVerifier(emitError, params, constraints,
-                                  paramConstraints);
-  };
-  return verifier;
-}
-
 /// Load all dialects in the given module, without loading any operation, type
 /// or attribute definitions.
 static DenseMap<DialectOp, ExtensibleDialect *> loadEmptyDialects(ModuleOp op) {
@@ -298,33 +108,9 @@ LogicalResult mlir::irdl::loadDialects(ModuleOp op) {
   DenseMap<AttributeOp, std::unique_ptr<DynamicAttrDefinition>> attrs =
       preallocateAttrDefs(op, dialects);
 
-  // Set the verifier for types.
-  WalkResult res = op.walk([&](TypeOp typeOp) {
-    DynamicAttrDefinition::VerifierFn verifier = getAttrOrTypeVerifier(
-        typeOp, dialects[typeOp.getParentOp()], types, attrs);
-    if (!verifier)
-      return WalkResult::interrupt();
-    types[typeOp]->setVerifyFn(std::move(verifier));
-    return WalkResult::advance();
-  });
-  if (res.wasInterrupted())
-    return failure();
-
-  // Set the verifier for attributes.
-  res = op.walk([&](AttributeOp attrOp) {
-    DynamicAttrDefinition::VerifierFn verifier = getAttrOrTypeVerifier(
-        attrOp, dialects[attrOp.getParentOp()], types, attrs);
-    if (!verifier)
-      return WalkResult::interrupt();
-    attrs[attrOp]->setVerifyFn(std::move(verifier));
-    return WalkResult::advance();
-  });
-  if (res.wasInterrupted())
-    return failure();
-
   // Define and load all operations.
-  res = op.walk([&](OperationOp opOp) {
-    return loadOperation(opOp, dialects[opOp.getParentOp()], types, attrs);
+  WalkResult res = op.walk([&](OperationOp opOp) {
+    return loadOperation(opOp, dialects[opOp.getParentOp()]);
   });
   if (res.wasInterrupted())
     return failure();

diff  --git a/mlir/test/Dialect/IRDL/testd.mlir b/mlir/test/Dialect/IRDL/testd.mlir
index e9be54b60d0b9..f6d1bcb0e396f 100644
--- a/mlir/test/Dialect/IRDL/testd.mlir
+++ b/mlir/test/Dialect/IRDL/testd.mlir
@@ -45,13 +45,6 @@ func.func @succeededEqConstraint() {
   return
 }
 
-// -----
-
-func.func @failedEqConstraint() {
-  // expected-error at +1 {{expected 'i32' but got 'i64'}}
-  "testd.eq"() : () -> i64
-  return
-}
 
 // -----
 
@@ -81,13 +74,6 @@ func.func @succeededDynBaseConstraint() {
   return
 }
 
-// -----
-
-func.func @failedDynBaseConstraint() {
-  // expected-error at +1 {{expected base type 'testd.parametric' but got 'i32'}}
-  "testd.dynbase"() : () -> i32
-  return
-}
 
 // -----
 
@@ -103,22 +89,6 @@ func.func @succeededDynParamsConstraint() {
 
 // -----
 
-func.func @failedDynParamsConstraintBase() {
-  // expected-error at +1 {{expected base type 'testd.parametric' but got 'i32'}}
-  "testd.dynparams"() : () -> i32
-  return
-}
-
-// -----
-
-func.func @failedDynParamsConstraintParam() {
-  // expected-error at +1 {{expected 'i32' but got 'i1'}}
-  "testd.dynparams"() : () -> !testd.parametric<i1>
-  return
-}
-
-// -----
-
 //===----------------------------------------------------------------------===//
 // Constraint variables
 //===----------------------------------------------------------------------===//
@@ -136,11 +106,3 @@ func.func @succeededConstraintVars2() {
   "testd.constraint_vars"() : () -> (i64, i64)
   return
 }
-
-// -----
-
-func.func @failedConstraintVars() {
-  // expected-error at +1 {{expected 'i64' but got 'i32'}}
-  "testd.constraint_vars"() : () -> (i64, i32)
-  return
-}


        


More information about the Mlir-commits mailing list