[all-commits] [llvm/llvm-project] 5bec1e: [mlir] Added oilist primitive

Shraiysh via All-commits all-commits at lists.llvm.org
Wed Feb 16 21:40:42 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5bec1ea7a74895895e7831fd951dd8130d4f3d01
      https://github.com/llvm/llvm-project/commit/5bec1ea7a74895895e7831fd951dd8130d4f3d01
  Author: Shraiysh Vaishay <Shraiysh.Vaishay at amd.com>
  Date:   2022-02-17 (Thu, 17 Feb 2022)

  Changed paths:
    M mlir/docs/OpDefinitions.md
    M mlir/test/IR/traits.mlir
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/mlir-tblgen/op-format-spec.td
    M mlir/tools/mlir-tblgen/FormatGen.cpp
    M mlir/tools/mlir-tblgen/FormatGen.h
    M mlir/tools/mlir-tblgen/OpFormatGen.cpp

  Log Message:
  -----------
  [mlir] Added oilist primitive

This patch attempts to add the `oilist` primitive proposed in the [[ https://llvm.discourse.group/t/rfc-extending-declarative-assembly-format-to-support-order-independent-variadic-segments/4388 | RFC: Extending Declarative Assembly Format to support order-independent variadic segments ]].

This element supports optional order-independent variadic segments for operations. This will allow OpenACC and OpenMP Dialects to have similar and relaxed requirements while encouraging the use of Declarative Assembly Format and avoiding code duplication.

An oilist element parses grammar of the form:
```
clause-list := clause clause-list | empty
clause := `keyword` clause1 | `otherKeyword` clause2
clause1 := <assembly-format element>
clause2 := <assembly-format element>
```

AssemblyFormat specification:
```
let assemblyFormat = [{
  oilist( `keyword` clause1
        | `otherkeyword` clause2
        ...
        )
}];
```

Example:
```
oilist( `private` `(` $arg0 `:` type($arg0) `)`
      | `nowait`
      | `reduction` custom<ReductionClause>($arg1, type($arg1)))

oilist( `private` `=` $arg0 `:` type($arg0)
      | `reduction` `=` $arg1 `:` type($arg1)
      | `firstprivate` `=` $arg3 `:` type($arg2))
```

Reviewed By: Mogball, rriddle

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




More information about the All-commits mailing list