[all-commits] [llvm/llvm-project] 1aa0b8: [mlir][ods] Fix OpFormatGen calling inferReturnTyp...

Jeff Niu via All-commits all-commits at lists.llvm.org
Thu Dec 16 11:05:02 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1aa0b84fa468076262e18d5071d284cac5b402a3
      https://github.com/llvm/llvm-project/commit/1aa0b84fa468076262e18d5071d284cac5b402a3
  Author: Mogball <jeffniu22 at gmail.com>
  Date:   2021-12-16 (Thu, 16 Dec 2021)

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

  Log Message:
  -----------
  [mlir][ods] Fix OpFormatGen calling inferReturnTypes before region/segment resolution

The generated parser for ops with type inference calls `inferReturnTypes` before region resolution and segment attribute resolution, i.e. regions and the segment attributes are not passed to the `inferReturnTypes` even though it may need that information.

In particular, an op that has sized operand segments which queries those operands in its `inferReturnTypes` function will crash because the segment attributes hadn't been added yet.

Reviewed By: rriddle

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




More information about the All-commits mailing list