[all-commits] [llvm/llvm-project] 039344: [mlir][ODS] Automatically create `result_segment_s...

zero9178 via All-commits all-commits at lists.llvm.org
Thu Aug 25 10:09:36 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0393443bf8069fbfaabcc64ee276ac7da5cf2814
      https://github.com/llvm/llvm-project/commit/0393443bf8069fbfaabcc64ee276ac7da5cf2814
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2022-08-25 (Thu, 25 Aug 2022)

  Changed paths:
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/mlir-tblgen/op-result.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [mlir][ODS] Automatically create `result_segment_sizes` in builder

When using multiple variadic results of differing sizes, using `AttrSizedResultSegments` is currently a requirement. Unlike `AttrSizedOperandSegments` however, it is not created within the default builders created by tablegen. Instead, one has to explicitly add `DenseI32ArrayAttr:$result_segments_sizes` as argument and then also explicitly specify all the sizes when using the builder from C++.

This patch fixes that redundancy, by making the builder generate the attribute in similar fashion as it already does for `AttrSizedOperandSegments`. The sizes required are simply gathered from the result type arguments of the builder.

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




More information about the All-commits mailing list