[all-commits] [llvm/llvm-project] 42e5f1: [mlir] Refactor how additional verification is spe...

River Riddle via All-commits all-commits at lists.llvm.org
Wed Feb 2 13:35:40 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 42e5f1d97b3ecf6f967a0e63ca39f05d3262e2b2
      https://github.com/llvm/llvm-project/commit/42e5f1d97b3ecf6f967a0e63ca39f05d3262e2b2
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M flang/tools/tco/tco.cpp
    M mlir/docs/OpDefinitions.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/Parser.h
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Target/SPIRV/Serialization/Serializer.cpp
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/mlir-tblgen/op-decl-and-defs.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [mlir] Refactor how additional verification is specified in ODS

Currently if an operation requires additional verification, it specifies an inline
code block (`let verifier = "blah"`). This is quite problematic for various reasons, e.g.
it requires defining C++ inside of Tablegen which is discouraged when possible, but mainly because
nearly all usages simply forward to a static function `static LogicalResult verify(SomeOp op)`.
This commit adds support for a `hasVerifier` bit field that specifies if an additional verifier
is needed, and when set to `1` declares a `LogicalResult verify()` method for operations to
override. For migration purposes, the existing behavior is untouched. Upstream usages will
be replaced in a followup to keep this patch focused on the hasVerifier implementation.

One main user facing change is that what was one `MyOp::verify` is now `MyOp::verifyInvariants`.
This better matches the name this method is called everywhere else, and also frees up `verify` for
the user defined additional verification. The `verify` function when generated now (for additional
verification) is private to the operation class, which should also help avoid accidental usages after
this switch.

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


  Commit: 4e190c58de7b52a0d6b2052a96c6f5933cb50b47
      https://github.com/llvm/llvm-project/commit/4e190c58de7b52a0d6b2052a96c6f5933cb50b47
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M mlir/docs/Tutorials/Toy/Ch-2.md
    M mlir/examples/toy/Ch2/include/toy/Ops.td
    M mlir/examples/toy/Ch2/mlir/Dialect.cpp
    M mlir/examples/toy/Ch3/include/toy/Ops.td
    M mlir/examples/toy/Ch3/mlir/Dialect.cpp
    M mlir/examples/toy/Ch4/include/toy/Ops.td
    M mlir/examples/toy/Ch4/mlir/Dialect.cpp
    M mlir/examples/toy/Ch5/include/toy/Ops.td
    M mlir/examples/toy/Ch5/mlir/Dialect.cpp
    M mlir/examples/toy/Ch6/include/toy/Ops.td
    M mlir/examples/toy/Ch6/mlir/Dialect.cpp
    M mlir/examples/toy/Ch7/include/toy/Ops.td
    M mlir/examples/toy/Ch7/mlir/Dialect.cpp

  Log Message:
  -----------
  [mlir][NFC] Update Toy operations to use `hasVerifier` instead of `verifier`

The verifier field is deprecated, and slated for removal.

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


  Commit: f7d85f010f0963b828875894dc56298e84ff9031
      https://github.com/llvm/llvm-project/commit/f7d85f010f0963b828875894dc56298e84ff9031
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M mlir/docs/Dialects/SPIR-V.md
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBarrierOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBitOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCastOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCompositeOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVControlFlowOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCooperativeMatrixOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGLSLOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGroupOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVImageOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMatrixOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMemoryOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMiscOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOCLOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td
    M mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp

  Log Message:
  -----------
  [mlir][NFC] Update SPIRV operations to use `hasVerifier` instead of `verifier`

The verifier field is deprecated, and slated for removal.

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


  Commit: 38abdddf6f660c6d71d1c018ee1f2a1b46808f68
      https://github.com/llvm/llvm-project/commit/38abdddf6f660c6d71d1c018ee1f2a1b46808f68
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/AMX/AMX.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h
    M mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
    M mlir/include/mlir/Dialect/X86Vector/X86Vector.td
    M mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp
    M mlir/lib/Dialect/AMX/IR/AMXDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
    M mlir/lib/Dialect/X86Vector/IR/X86VectorDialect.cpp

  Log Message:
  -----------
  [mlir][NFC] Update AMX/LLVM/NVVM/X86 vector operations to use `hasVerifier` instead of `verifier`

The verifier field is deprecated, and slated for removal.

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


  Commit: bdc7ce975a8dae66a010320a11b4eb75b4c6c895
      https://github.com/llvm/llvm-project/commit/bdc7ce975a8dae66a010320a11b4eb75b4c6c895
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
    M mlir/lib/Dialect/Vector/IR/VectorOps.cpp

  Log Message:
  -----------
  [mlir][NFC] Update Vector operations to use `hasVerifier` instead of `verifier`

The verifier field is deprecated, and slated for removal.

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


  Commit: b98dc0351aefaa069f6a8f0cdc3800dc69918741
      https://github.com/llvm/llvm-project/commit/b98dc0351aefaa069f6a8f0cdc3800dc69918741
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
    M mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
    M mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
    M mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
    M mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
    M mlir/lib/Dialect/Tensor/IR/TensorOps.cpp

  Log Message:
  -----------
  [mlir][NFC] Update MemRef/Tensor operations to use `hasVerifier` instead of `verifier`

The verifier field is deprecated, and slated for removal.

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


  Commit: ef72cf4413f054a98c8042d8de8121590df4a80f
      https://github.com/llvm/llvm-project/commit/ef72cf4413f054a98c8042d8de8121590df4a80f
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
    M mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
    M mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
    M mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
    M mlir/test/Dialect/OpenACC/invalid.mlir

  Log Message:
  -----------
  [mlir][NFC] Update OpenACC/OpenMP operations to use `hasVerifier` instead of `verifier`

The verifier field is deprecated, and slated for removal.

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


  Commit: 4809da8eaf2fd13dc9cdf8695103b0c36b03bfb9
      https://github.com/llvm/llvm-project/commit/4809da8eaf2fd13dc9cdf8695103b0c36b03bfb9
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp

  Log Message:
  -----------
  [mlir][NFC] Update Affine operations to use `hasVerifier` instead of `verifier`

The verifier field is deprecated, and slated for removal.

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


  Commit: 094ede6d20dcccc65afba1657c874df3462bdf01
      https://github.com/llvm/llvm-project/commit/094ede6d20dcccc65afba1657c874df3462bdf01
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/GPU/GPUOps.td
    M mlir/include/mlir/Dialect/SCF/SCFOps.td
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/lib/Dialect/SCF/SCF.cpp

  Log Message:
  -----------
  [mlir][NFC] Update GPU/SCF operations to use `hasVerifier` instead of `verifier`

The verifier field is deprecated, and slated for removal.

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


  Commit: 0d86e53e188490aa7ab8ff0f860dc12c48d7c2f4
      https://github.com/llvm/llvm-project/commit/0d86e53e188490aa7ab8ff0f860dc12c48d7c2f4
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
    M mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
    M mlir/lib/Dialect/PDL/IR/PDL.cpp
    M mlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp

  Log Message:
  -----------
  [mlir][NFC] Update PDL operations to use `hasVerifier` instead of `verifier`

The verifier field is deprecated, and slated for removal.

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


  Commit: 1be88f5ab1bd23f019f3f189722d2274365fa01f
      https://github.com/llvm/llvm-project/commit/1be88f5ab1bd23f019f3f189722d2274365fa01f
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td
    M mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
    M mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
    M mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
    M mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
    M mlir/include/mlir/Dialect/Quant/QuantOps.td
    M mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
    M mlir/include/mlir/IR/BuiltinOps.td
    M mlir/include/mlir/IR/OpBase.td
    M mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
    M mlir/lib/Dialect/Async/IR/Async.cpp
    M mlir/lib/Dialect/Complex/IR/ComplexOps.cpp
    M mlir/lib/Dialect/EmitC/IR/EmitC.cpp
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/lib/Dialect/Quant/IR/QuantOps.cpp
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
    M mlir/lib/IR/BuiltinDialect.cpp
    M mlir/test/mlir-tblgen/op-decl-and-defs.td

  Log Message:
  -----------
  [mlir][NFC] Update remaining dialect operations to use `hasVerifier` instead of `verifier`

The verifier field is deprecated, and slated for removal.

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


Compare: https://github.com/llvm/llvm-project/compare/7e9d19016eae...1be88f5ab1bd


More information about the All-commits mailing list