[all-commits] [llvm/llvm-project] 9445b3: [mlir] Support verification order (2/3)

ChiaHungDuan via All-commits all-commits at lists.llvm.org
Fri Feb 25 11:09:11 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9445b39673c81e9b5ffeda0f71be0c1476e9f313
      https://github.com/llvm/llvm-project/commit/9445b39673c81e9b5ffeda0f71be0c1476e9f313
  Author: Chia-hung Duan <chiahungduan at google.com>
  Date:   2022-02-25 (Fri, 25 Feb 2022)

  Changed paths:
    M mlir/docs/OpDefinitions.md
    M mlir/docs/Traits.md
    M mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/include/mlir/TableGen/Interfaces.h
    M mlir/include/mlir/TableGen/Trait.h
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/IR/MLIRContext.cpp
    M mlir/lib/IR/Verifier.cpp
    M mlir/lib/TableGen/Interfaces.cpp
    M mlir/lib/TableGen/Trait.cpp
    M mlir/test/Dialect/Arithmetic/invalid.mlir
    M mlir/test/Dialect/GPU/invalid.mlir
    M mlir/test/Dialect/LLVMIR/global.mlir
    M mlir/test/Dialect/Linalg/invalid.mlir
    M mlir/test/Dialect/Linalg/named-ops.mlir
    M mlir/test/Dialect/SPIRV/IR/bit-ops.mlir
    M mlir/test/Dialect/Shape/invalid.mlir
    M mlir/test/Dialect/traits.mlir
    M mlir/test/IR/invalid-module-op.mlir
    M mlir/test/IR/traits.mlir
    M mlir/test/mlir-tblgen/op-decl-and-defs.td
    M mlir/test/mlir-tblgen/op-interface.td
    M mlir/test/mlir-tblgen/types.mlir
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
    M mlir/tools/mlir-tblgen/OpInterfacesGen.cpp

  Log Message:
  -----------
  [mlir] Support verification order (2/3)

    This change gives explicit order of verifier execution and adds
    `hasRegionVerifier` and `verifyWithRegions` to increase the granularity
    of verifier classification. The orders are as below,

    1. InternalOpTrait will be verified first, they can be run independently.
    2. `verifyInvariants` which is constructed by ODS, it verifies the type,
       attributes, .etc.
    3. Other Traits/Interfaces that have marked their verifier as
       `verifyTrait` or `verifyWithRegions=0`.
    4. Custom verifier which is defined in the op and has marked
       `hasVerifier=1`

    If an operation has regions, then it may have the second phase,

    5. Traits/Interfaces that have marked their verifier as
       `verifyRegionTrait` or
       `verifyWithRegions=1`. This implies the verifier needs to access the
       operations in its regions.
    6. Custom verifier which is defined in the op and has marked
       `hasRegionVerifier=1`

    Note that the second phase will be run after the operations in the
    region are verified. Based on the verification order, you will be able to
    avoid verifying duplicate things.

Reviewed By: Mogball

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




More information about the All-commits mailing list