[all-commits] [llvm/llvm-project] 485cc5: [mlir] Generare .cpp.inc files for dialects.

Stella Laurenzo via All-commits all-commits at lists.llvm.org
Tue Jun 29 13:12:43 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 485cc55edfb875628e19bb6d9de4706af2865d3e
      https://github.com/llvm/llvm-project/commit/485cc55edfb875628e19bb6d9de4706af2865d3e
  Author: Stella Laurenzo <stellaraccident at gmail.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M mlir/cmake/modules/AddMLIR.cmake
    M mlir/examples/standalone/lib/Standalone/StandaloneDialect.cpp
    M mlir/examples/toy/Ch2/include/toy/CMakeLists.txt
    M mlir/examples/toy/Ch2/mlir/Dialect.cpp
    M mlir/examples/toy/Ch3/include/toy/CMakeLists.txt
    M mlir/examples/toy/Ch3/mlir/Dialect.cpp
    M mlir/examples/toy/Ch4/include/toy/CMakeLists.txt
    M mlir/examples/toy/Ch4/mlir/Dialect.cpp
    M mlir/examples/toy/Ch5/include/toy/CMakeLists.txt
    M mlir/examples/toy/Ch5/mlir/Dialect.cpp
    M mlir/examples/toy/Ch6/include/toy/CMakeLists.txt
    M mlir/examples/toy/Ch6/mlir/Dialect.cpp
    M mlir/examples/toy/Ch7/include/toy/CMakeLists.txt
    M mlir/examples/toy/Ch7/mlir/Dialect.cpp
    M mlir/include/mlir/Dialect/LLVMIR/CMakeLists.txt
    M mlir/include/mlir/Dialect/OpenACC/CMakeLists.txt
    M mlir/include/mlir/Dialect/OpenMP/CMakeLists.txt
    M mlir/include/mlir/Dialect/StandardOps/IR/CMakeLists.txt
    M mlir/include/mlir/IR/CMakeLists.txt
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/TableGen/Dialect.h
    M mlir/lib/Dialect/AMX/IR/AMXDialect.cpp
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/ArmNeon/IR/ArmNeonDialect.cpp
    M mlir/lib/Dialect/ArmSVE/IR/ArmSVEDialect.cpp
    M mlir/lib/Dialect/Async/IR/Async.cpp
    M mlir/lib/Dialect/Complex/IR/ComplexDialect.cpp
    M mlir/lib/Dialect/DLTI/DLTI.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/Math/IR/MathDialect.cpp
    M mlir/lib/Dialect/MemRef/IR/MemRefDialect.cpp
    M mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
    M mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
    M mlir/lib/Dialect/PDL/IR/PDL.cpp
    M mlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp
    M mlir/lib/Dialect/Quant/IR/QuantOps.cpp
    M mlir/lib/Dialect/SCF/SCF.cpp
    M mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/lib/Dialect/Tensor/IR/TensorDialect.cpp
    M mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
    M mlir/lib/Dialect/Vector/VectorOps.cpp
    M mlir/lib/Dialect/X86Vector/IR/X86VectorDialect.cpp
    M mlir/lib/IR/BuiltinDialect.cpp
    M mlir/lib/TableGen/Dialect.cpp
    M mlir/test/lib/Dialect/Test/CMakeLists.txt
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/tools/mlir-tblgen/DialectGen.cpp
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
    M utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel

  Log Message:
  -----------
  [mlir] Generare .cpp.inc files for dialects.

* Previously, we were only generating .h.inc files. We foresee the need to also generate implementations and this is a step towards that.
* Discussed in https://llvm.discourse.group/t/generating-cpp-inc-files-for-dialects/3732/2
* Deviates from the discussion above by generating a default constructor in the .cpp.inc file (and adding a tablegen bit that disables this in case if this is user provided).
* Generating the destructor started as a way to flush out the missing includes (produces a link error), but it is a strict improvement on its own that is worth doing (i.e. by emitting key methods in the .cpp file, we root vtables in one translation unit, which is a non-controversial improvement).

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




More information about the All-commits mailing list