[all-commits] [llvm/llvm-project] fd8796: Change dialect `printOperation()` hook to `getOper...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Tue Aug 31 10:53:00 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd87963eee23f6cf2aed97bf182a6b3f5e9450ed
      https://github.com/llvm/llvm-project/commit/fd87963eee23f6cf2aed97bf182a6b3f5e9450ed
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2021-08-31 (Tue, 31 Aug 2021)

  Changed paths:
    M mlir/include/mlir/IR/Dialect.h
    M mlir/lib/IR/AsmPrinter.cpp
    M mlir/lib/IR/Dialect.cpp
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td

  Log Message:
  -----------
  Change dialect `printOperation()` hook to `getOperationPrinter()`

This makes the hook return a printer if available, instead of using LogicalResult  to
indicate if a printer was available (and invoked). This allows the caller to detect that
the dialect has a printer for a given operation without actually invoking the printer.
It'll be leveraged in a future revision to move printing the op name itself under control
of the ASMPrinter.

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


  Commit: c41b16c26bdb52fa8beb447e7c8eec8c8924874a
      https://github.com/llvm/llvm-project/commit/c41b16c26bdb52fa8beb447e7c8eec8c8924874a
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2021-08-31 (Tue, 31 Aug 2021)

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M mlir/examples/toy/Ch2/mlir/Dialect.cpp
    M mlir/examples/toy/Ch3/mlir/Dialect.cpp
    M mlir/examples/toy/Ch4/mlir/Dialect.cpp
    M mlir/examples/toy/Ch5/mlir/Dialect.cpp
    M mlir/examples/toy/Ch6/mlir/Dialect.cpp
    M mlir/examples/toy/Ch7/mlir/Dialect.cpp
    M mlir/include/mlir/Dialect/GPU/GPUOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
    M mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/include/mlir/IR/OpImplementation.h
    M mlir/lib/Dialect/Affine/IR/AffineOps.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/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/SCF/SCF.cpp
    M mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/lib/Dialect/Vector/VectorOps.cpp
    M mlir/lib/IR/AsmPrinter.cpp
    M mlir/lib/IR/FunctionImplementation.cpp
    M mlir/lib/IR/Operation.cpp
    M mlir/test/Dialect/Standard/expand-ops.mlir
    M mlir/test/IR/invalid-ops.mlir
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/tools/mlir-tblgen/OpFormatGen.cpp

  Log Message:
  -----------
  Change ASM Op printer to print the operation name in the framework instead of leaving it up to each individual operation

This aligns the printer with the parser contract: the operation isn't part of the user-controllable part of the syntax.

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


  Commit: 387f95541bdc575f75bba95d323b51198d3b9e2b
      https://github.com/llvm/llvm-project/commit/387f95541bdc575f75bba95d323b51198d3b9e2b
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2021-08-31 (Tue, 31 Aug 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td
    M mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/include/mlir/IR/BuiltinOps.h
    M mlir/include/mlir/IR/BuiltinOps.td
    M mlir/include/mlir/IR/OpAsmInterface.td
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/lib/IR/AsmPrinter.cpp
    M mlir/lib/IR/Operation.cpp
    M mlir/lib/Parser/Parser.cpp
    M mlir/lib/Parser/ParserState.h
    M mlir/test/Analysis/test-shape-fn-report.mlir
    M mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
    M mlir/test/Conversion/GPUToNVVM/wmma-ops-to-nvvm.mlir
    M mlir/test/Conversion/GPUToROCDL/gpu-to-rocdl.mlir
    M mlir/test/Conversion/VectorToROCDL/vector-to-rocdl.mlir
    M mlir/test/Dialect/Builtin/canonicalize.mlir
    M mlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir
    M mlir/test/Dialect/Linalg/reshape_control_fusion.mlir
    M mlir/test/Dialect/Shape/invalid.mlir
    M mlir/test/Dialect/SparseTensor/sparse_perm.mlir
    M mlir/test/Dialect/SparseTensor/sparse_perm_lower.mlir
    M mlir/test/IR/invalid-func-op.mlir
    M mlir/test/IR/invalid-module-op.mlir
    M mlir/test/IR/invalid-ops.mlir
    M mlir/test/IR/invalid.mlir
    M mlir/test/IR/parser.mlir
    M mlir/test/IR/traits.mlir
    M mlir/test/Transforms/canonicalize-dce.mlir
    M mlir/test/Transforms/canonicalize.mlir
    M mlir/test/Transforms/constant-fold.mlir
    M mlir/test/Transforms/cse.mlir
    M mlir/test/Transforms/test-legalizer-full.mlir
    M mlir/test/lib/Dialect/Test/TestOps.td

  Log Message:
  -----------
  Add a new interface allowing to set a default dialect to be used for printing/parsing regions

Currently the builtin dialect is the default namespace used for parsing
and printing. As such module and func don't need to be prefixed.
In the case of some dialects that defines new regions for their own
purpose (like SpirV modules for example), it can be beneficial to
change the default dialect in order to improve readability.

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


Compare: https://github.com/llvm/llvm-project/compare/6726a3d858ac...387f95541bdc


More information about the All-commits mailing list