[all-commits] [llvm/llvm-project] b86a13: Revert "Expose callbacks for encoding of types/att...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Fri Jul 28 16:46:01 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b86a13211fcd84bfae39066b51f9f079f970cea8
      https://github.com/llvm/llvm-project/commit/b86a13211fcd84bfae39066b51f9f079f970cea8
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2023-07-28 (Fri, 28 Jul 2023)

  Changed paths:
    M mlir/include/mlir/Bytecode/BytecodeImplementation.h
    M mlir/include/mlir/Bytecode/BytecodeReader.h
    R mlir/include/mlir/Bytecode/BytecodeReaderConfig.h
    M mlir/include/mlir/Bytecode/BytecodeWriter.h
    M mlir/include/mlir/IR/AsmState.h
    M mlir/lib/Bytecode/Reader/BytecodeReader.cpp
    M mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
    M mlir/lib/Bytecode/Writer/IRNumbering.cpp
    R mlir/test/Bytecode/bytecode_callback.mlir
    R mlir/test/Bytecode/bytecode_callback_full_override.mlir
    R mlir/test/Bytecode/bytecode_callback_with_custom_attribute.mlir
    R mlir/test/Bytecode/bytecode_callback_with_custom_type.mlir
    M mlir/test/Bytecode/invalid/invalid_attr_type_section.mlir
    M mlir/test/lib/Dialect/Test/TestDialect.h
    M mlir/test/lib/Dialect/Test/TestDialectInterfaces.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/lib/Dialect/Test/TestTypeDefs.td
    M mlir/test/lib/IR/CMakeLists.txt
    R mlir/test/lib/IR/TestBytecodeCallbacks.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  Revert "Expose callbacks for encoding of types/attributes"

This reverts commit b299ec16661f653df66cdaf161cdc5441bc9803c.

The authorship informations were incorrect.


  Commit: bff6a4292f80d058c9eaf17c2b0532a780757cec
      https://github.com/llvm/llvm-project/commit/bff6a4292f80d058c9eaf17c2b0532a780757cec
  Author: Matteo Franciolini <m_franciolini at apple.com>
  Date:   2023-07-28 (Fri, 28 Jul 2023)

  Changed paths:
    M mlir/include/mlir/Bytecode/BytecodeImplementation.h
    M mlir/include/mlir/Bytecode/BytecodeReader.h
    A mlir/include/mlir/Bytecode/BytecodeReaderConfig.h
    M mlir/include/mlir/Bytecode/BytecodeWriter.h
    M mlir/include/mlir/IR/AsmState.h
    M mlir/lib/Bytecode/Reader/BytecodeReader.cpp
    M mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
    M mlir/lib/Bytecode/Writer/IRNumbering.cpp
    A mlir/test/Bytecode/bytecode_callback.mlir
    A mlir/test/Bytecode/bytecode_callback_full_override.mlir
    A mlir/test/Bytecode/bytecode_callback_with_custom_attribute.mlir
    A mlir/test/Bytecode/bytecode_callback_with_custom_type.mlir
    M mlir/test/Bytecode/invalid/invalid_attr_type_section.mlir
    M mlir/test/lib/Dialect/Test/TestDialect.h
    M mlir/test/lib/Dialect/Test/TestDialectInterfaces.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/lib/Dialect/Test/TestTypeDefs.td
    M mlir/test/lib/IR/CMakeLists.txt
    A mlir/test/lib/IR/TestBytecodeCallbacks.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  Expose callbacks for encoding of types/attributes

[mlir] Expose a mechanism to provide a callback for encoding types and attributes in MLIR bytecode.

Two callbacks are exposed, respectively, to the BytecodeWriterConfig and to the ParserConfig. At bytecode parsing/printing, clients have the ability to specify a callback to be used to optionally read/write the encoding. On failure, fallback path will execute the default parsers and printers for the dialect.

Testing shows how to leverage this functionality to support back-deployment and backward-compatibility usecases when roundtripping to bytecode a client dialect with type/attributes dependencies on upstream.

Reviewed By: rriddle

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


Compare: https://github.com/llvm/llvm-project/compare/b08d358e8ac8...bff6a4292f80


More information about the All-commits mailing list