[all-commits] [llvm/llvm-project] 88c6e2: [mlir][OpFormatGen] Add support for specifiy "cust...

River Riddle via All-commits all-commits at lists.llvm.org
Mon Aug 31 13:27:06 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 88c6e25e4f0630bd9204cb02787fcb67e097a43a
      https://github.com/llvm/llvm-project/commit/88c6e25e4f0630bd9204cb02787fcb67e097a43a
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-08-31 (Mon, 31 Aug 2020)

  Changed paths:
    M mlir/docs/OpDefinitions.md
    M mlir/include/mlir/IR/OpImplementation.h
    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/test/mlir-tblgen/op-format.mlir
    M mlir/tools/mlir-tblgen/OpFormatGen.cpp

  Log Message:
  -----------
  [mlir][OpFormatGen] Add support for specifiy "custom" directives.

This revision adds support for custom directives to the declarative assembly format. This allows for users to use C++ for printing and parsing subsections of an otherwise declaratively specified format. The custom directive is structured as follows:

```
custom-directive ::= `custom` `<` UserDirective `>` `(` Params `)`
```

`user-directive` is used as a suffix when this directive is used during printing and parsing. When parsing, `parseUserDirective` will be invoked. When printing, `printUserDirective` will be invoked. The first parameter to these methods must be a reference to either the OpAsmParser, or OpAsmPrinter. The type of rest of the parameters is dependent on the `Params` specified in the assembly format.

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


  Commit: 24b88920fed750c864e30add6a0fefe58f1a9f54
      https://github.com/llvm/llvm-project/commit/24b88920fed750c864e30add6a0fefe58f1a9f54
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-08-31 (Mon, 31 Aug 2020)

  Changed paths:
    M mlir/include/mlir/IR/OpBase.td
    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] Add new SymbolNameAttr and add support for in assemblyFormat

Symbol names are a special form of StringAttr that get treated specially in certain areas, such as formatting. This revision adds a special derived attr for them in ODS and adds support in the assemblyFormat for formatting them properly.

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


  Commit: eaeadce9bd11d50cecfdf9e97ac471acd38136ee
      https://github.com/llvm/llvm-project/commit/eaeadce9bd11d50cecfdf9e97ac471acd38136ee
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-08-31 (Mon, 31 Aug 2020)

  Changed paths:
    M mlir/docs/OpDefinitions.md
    M mlir/include/mlir/IR/OpImplementation.h
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/lib/IR/OperationSupport.cpp
    M mlir/lib/Parser/AttributeParser.cpp
    M mlir/lib/Parser/Parser.cpp
    M mlir/lib/Parser/Parser.h
    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/test/mlir-tblgen/op-format.mlir
    M mlir/tools/mlir-tblgen/OpFormatGen.cpp

  Log Message:
  -----------
  [mlir][OpFormatGen] Add initial support for regions in the custom op assembly format

This adds some initial support for regions and does not support formatting the specific arguments of a region. For now this can be achieved by using a custom directive that formats the arguments and then parses the region.

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


  Commit: 2481846a303dc6b99d4eebe761e2e3ffccead448
      https://github.com/llvm/llvm-project/commit/2481846a303dc6b99d4eebe761e2e3ffccead448
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-08-31 (Mon, 31 Aug 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
    M mlir/lib/Dialect/PDL/IR/PDL.cpp

  Log Message:
  -----------
  [mlir][PDL] Move the formats for PatternOp and RewriteOp to the declarative form.

This is possible now that the declarative assembly form supports regions.

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


Compare: https://github.com/llvm/llvm-project/compare/61e15ecab509...2481846a303d


More information about the All-commits mailing list