[all-commits] [llvm/llvm-project] a26347: [mlir][spirv] Remove template functions for gettin...

Lei Zhang via All-commits all-commits at lists.llvm.org
Thu May 7 06:32:32 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a2634748cd82762341b87c5b00f374b71f18535a
      https://github.com/llvm/llvm-project/commit/a2634748cd82762341b87c5b00f374b71f18535a
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/SPIRV/SPIRVBinaryUtils.h
    M mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
    M mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp

  Log Message:
  -----------
  [mlir][spirv] Remove template functions for getting op's opcode

These template functions are used in the serializer, where we can
actually directly query the opcode from the op's definition and
use that in the auto-generated serialization logic.

This removes a set of templates accounting for 319 lines from
the auto-generated inc file.

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


  Commit: 16027bbc3ba3332f1bce1675ad2924c6800412ce
      https://github.com/llvm/llvm-project/commit/16027bbc3ba3332f1bce1675ad2924c6800412ce
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp

  Log Message:
  -----------
  [mlir][spirv] Serialize all operands together if possible

SPIR-V ops can mix operands and attributes in the definition. These
operands and attributes are serialized in the exact order of the definition
to match SPIR-V binary format requirements. It can cause excessive
generated code bloat because we are emitting code to handle each
operand/attribute separately. So here we probe first to check whether all
the operands are ahead of attributes. Then we can serialize all operands
together.

This removes ~1000 lines of code from the generated inc file.

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


Compare: https://github.com/llvm/llvm-project/compare/3bbc71d6c969...16027bbc3ba3


More information about the All-commits mailing list