[all-commits] [llvm/llvm-project] 3ffd13: [mlir][irdl] Add IRDL verification constraint classes

Fehr Mathieu via All-commits all-commits at lists.llvm.org
Fri May 5 03:17:40 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3ffd13b183ed5472d4dc84d15769a511a28e7680
      https://github.com/llvm/llvm-project/commit/3ffd13b183ed5472d4dc84d15769a511a28e7680
  Author: Mathieu Fehr <mathieu.fehr at gmail.com>
  Date:   2023-05-05 (Fri, 05 May 2023)

  Changed paths:
    A mlir/include/mlir/Dialect/IRDL/IRDLVerifiers.h
    M mlir/lib/Dialect/IRDL/CMakeLists.txt
    A mlir/lib/Dialect/IRDL/IRDLVerifiers.cpp

  Log Message:
  -----------
  [mlir][irdl] Add IRDL verification constraint classes

This patch adds the necessary constraint classes that are be used
by IRDL to define Operation, Type, and Attribute verifiers.

A constraint is a class inheriting the `irdl::Constraint` class,
which may call other constraints that are indexed by `unsigned`.
A constraint represent an invariant over an Attribute.

The `ConstraintVerifier` class group these constraints together,
and make sure that a constraint can only identify a single
attribute. So, once a constraint is used to check the
satisfiability of an `Attribute`, the `Attribute` will be
memorized for this constraint. This ensure that in IRDL, a
single `!irdl.attribute` value only correspond to a single
`Attribute`.

Depends on D144693

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D145733




More information about the All-commits mailing list