| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[mlir:LSP] Add support for code completing attributes and types This required changing a bit of how attributes/types are parsed. A new KeywordSwitch class was added to AsmParser that provides a StringSwitch like API for parsing keywords with a set of potential matches. It intends to both provide a cleaner API, and enable injection for code completion. This required changing the API of generated(Attr|Type)Parser to handle the parsing of the keyword, instead of having the user do it. Most upstream dialects use the autogenerated handling and didn't require a direct update. Differential Revision: https://reviews.llvm.org/D129267 | 3 年前 | |
[mlir] Add a new "Pattern Descriptor Language" (PDL) dialect. PDL presents a high level abstraction for the rewrite pattern infrastructure available in MLIR. This abstraction allows for representing patterns transforming MLIR, as MLIR. This allows for applying all of the benefits that the general MLIR infrastructure provides, to the infrastructure itself. This means that pattern matching can be more easily verified for correctness, targeted by frontends, and optimized. PDL abstracts over various different aspects of patterns and core MLIR data structures. Patterns are specified via a pdl.pattern operation. These operations contain a region body for the "matcher" code, and terminate with a pdl.rewrite that either dispatches to an external rewriter or contains a region for the rewrite specified via pdl. The types of values in pdl are handle types to MLIR C++ types, with !pdl.attribute, !pdl.operation, and !pdl.type directly mapping to mlir::Attribute, mlir::Operation*, and mlir::Value respectively. An example pattern is shown below: ``mlir // pdl.pattern contains metadata similarly to a RewritePattern. pdl.pattern : benefit(1) { // External input operand values are specified via pdl.input operations. // Result types are constrainted via pdl.type operations. %resultType = pdl.type %inputOperand = pdl.input %root, %results = pdl.operation "foo.op"(%inputOperand) -> %resultType pdl.rewrite(%root) { pdl.replace %root with (%inputOperand) } } `` This is a culmination of the work originally discussed here: https://groups.google.com/a/tensorflow.org/g/mlir/c/j_bn74ByxlQ Differential Revision: https://reviews.llvm.org/D84578 | 5 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 年前 | ||
| 5 年前 |