[all-commits] [llvm/llvm-project] 4e103a: [mlir] Add support for VariadicOfVariadic operands

River Riddle via All-commits all-commits at lists.llvm.org
Mon Aug 23 13:42:23 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e103a12d9d6d03ad4147a0c9a8f5742538eefec
      https://github.com/llvm/llvm-project/commit/4e103a12d9d6d03ad4147a0c9a8f5742538eefec
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2021-08-23 (Mon, 23 Aug 2021)

  Changed paths:
    M mlir/docs/OpDefinitions.md
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/include/mlir/IR/TypeRange.h
    M mlir/include/mlir/TableGen/Argument.h
    M mlir/include/mlir/TableGen/Type.h
    M mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/lib/IR/Operation.cpp
    M mlir/lib/IR/OperationSupport.cpp
    M mlir/lib/TableGen/Argument.cpp
    M mlir/lib/TableGen/Operator.cpp
    M mlir/lib/TableGen/Type.cpp
    M mlir/test/IR/traits.mlir
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/mlir-tblgen/op-format.mlir
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
    M mlir/tools/mlir-tblgen/OpFormatGen.cpp

  Log Message:
  -----------
  [mlir] Add support for VariadicOfVariadic operands

This revision adds native ODS support for VariadicOfVariadic operand
groups. An example of this is the SwitchOp, which has a variadic number
of nested operand ranges for each of the case statements, where the
number of case statements is variadic. Builtin ODS support allows for
generating proper accessors for the nested operand ranges, builder
support, and declarative format support. VariadicOfVariadic operands
are supported by providing a segment attribute to use to store the
operand groups, mapping similarly to the AttrSizedOperand trait
(but with a user defined attribute name).

`build` methods for VariadicOfVariadic operand expect inputs of the
form `ArrayRef<ValueRange>`. Accessors for the variadic ranges
return a new `OperandRangeRange` type, which represents a
contiguous range of `OperandRange`. In the declarative assembly
format, VariadicOfVariadic operands and types are by default
formatted as a comma delimited list of value lists:
`(<value>, <value>), (), (<value>)`.

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




More information about the All-commits mailing list