[all-commits] [llvm/llvm-project] d7f008: [mlir:ODS] Deprecate Op parser/printer fields in f...

River Riddle via All-commits all-commits at lists.llvm.org
Mon Feb 7 19:04:30 PST 2022


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

  Changed paths:
    M mlir/include/mlir/IR/OpBase.td
    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:ODS] Deprecate Op parser/printer fields in favor of a new hasCustomAssemblyFormat field

Currently if an operation wants a C++ implemented parser/printer, it specifies inline
code blocks. 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 static functions (e.g. `static void parseSomeOp(...)`)
with users devising their own standards for how these are defined.

This commit adds support for a `hasCustomAssemblyFormat` bit field that specifies if
a C++ parser/printer is needed, and when set to 1 declares the parse/print methods 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 new implementation.

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


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

  Changed paths:
    M mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td
    M mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
    M mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
    M mlir/lib/Dialect/Arithmetic/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
    M mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp
    M mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
    M mlir/lib/Dialect/MemRef/Transforms/ExpandOps.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
    M mlir/lib/Dialect/SparseTensor/Utils/Merger.cpp
    M mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp

  Log Message:
  -----------
  [mlir][NFC] Remove a few op builders that simply swap parameter order

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


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

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVArithmeticOps.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/SPIRVGLSLOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOCLOps.td
    M mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
    M mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/IR/Operation.cpp

  Log Message:
  -----------
  [mlir][NFC] Remove deprecated/old build/fold/parser utilities from OpDefinition

These have generally been replaced by better ODS functionality, and do not
need to be explicitly provided anymore.

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


  Commit: 12bfd159b7602fee776d4a0d4b2f1193e875fd35
      https://github.com/llvm/llvm-project/commit/12bfd159b7602fee776d4a0d4b2f1193e875fd35
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-02-07 (Mon, 07 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] Update Toy operations to use the `hasCustomAssemblyFormat` field

The parser/printer fields are deprecated and in the process of being removed.


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

  Changed paths:
    M mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
    M mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td
    M mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
    M mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
    M mlir/include/mlir/Dialect/GPU/GPUOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
    M mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
    M mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
    M mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
    M mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
    M mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
    M mlir/include/mlir/Dialect/SCF/SCFOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.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/SPIRVGLSLOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOCLOps.td
    M mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
    M mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
    M mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
    M mlir/include/mlir/IR/BuiltinOps.td
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
    M mlir/lib/Dialect/Async/IR/Async.cpp
    M mlir/lib/Dialect/EmitC/IR/EmitC.cpp
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
    M mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
    M mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
    M mlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp
    M mlir/lib/Dialect/SCF/SCF.cpp
    M mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
    M mlir/lib/Dialect/Vector/IR/VectorOps.cpp
    M mlir/lib/IR/BuiltinDialect.cpp
    M mlir/test/Dialect/SPIRV/IR/bit-ops.mlir
    M mlir/test/Dialect/SPIRV/IR/logical-ops.mlir
    M mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp

  Log Message:
  -----------
  [mlir] Update uses of `parser`/`printer` ODS op field to `hasCustomAssemblyFormat`

The parser/printer fields are deprecated and in the process of being removed.


Compare: https://github.com/llvm/llvm-project/compare/45084eab5e63...2418cd92c034


More information about the All-commits mailing list