[ELF] Refactor merge-* tests
[llvm-project.git] / mlir / utils / tree-sitter-mlir / dialect / bufferization.js
blob8d9fdb1fcfc3994a0b87426b7c83e0ba6109c627
1 'use strict';
3 module.exports = {
4   bufferization_dialect : $ => choice(
5                             seq('bufferization.alloc_tensor',
6                                 field('in', $._value_use_list_parens),
7                                 field('copy', optional(seq(token('copy'), '(',
8                                                            $.value_use, ')'))),
9                                 field('size_hint',
10                                       optional(seq(token('size_hint'), '=',
11                                                    $.value_use))),
12                                 field('attributes', optional($.attribute)),
13                                 field('return', $._type_annotation)),
15                             // operation ::= `bufferization.to_memref` $tensor
16                             // attr-dict `:` type($memref)
17                             seq('bufferization.to_memref',
18                                 field('tensor', $.value_use),
19                                 field('attributes', optional($.attribute)),
20                                 field('return', $._type_annotation)),
22                             // operation ::= `bufferization.to_tensor` $memref
23                             //               (`restrict` $restrict^)?
24                             //               (`writable` $writable^)? attr-dict
25                             //               `:` type($memref)
26                             seq('bufferization.to_tensor',
27                                 field('memref', $.value_use),
28                                 field('restrict', optional($.restrict_attr)),
29                                 field('writable', optional($.writable_attr)),
30                                 field('attributes', optional($.attribute)),
31                                 field('return', $._type_annotation)))