Skip to content

Commit b8cc449

Browse files
committed
[MLIR][NFC] Update MLIR vim syntax file - std ops + types
Update vim syntax file to include more std ops, and for int types. Differential Revision: https://reviews.llvm.org/D86370
1 parent 12edd4b commit b8cc449

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

mlir/utils/vim/syntax/mlir.vim

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@ endif
1313
syn case match
1414

1515
" Types.
16+
"
1617
syn keyword mlirType index f16 f32 f64
17-
" Integer type.
18+
" Signless integer types.
1819
syn match mlirType /\<i\d\+\>/
20+
" Unsigned integer types.
21+
syn match mlirType /\<ui\d\+\>/
22+
" Signed integer types.
23+
syn match mlirType /\<si\d\+\>/
1924

2025
" Elemental types inside memref, tensor, or vector types.
21-
syn match mlirType /x\s*\zs\(f16\|f32\|f64\|i\d\+\)/
26+
syn match mlirType /x\s*\zs\(f16\|f32\|f64\|i\d\+\|ui\d\+\|si\d\+\)/
2227

2328
" Shaped types.
2429
syn match mlirType /\<memref\ze\s*<.*>/
@@ -29,13 +34,14 @@ syn match mlirType /\<vector\ze\s*<.*>/
2934
syn match mlirType /x\s*\zsvector/
3035

3136
" Operations.
32-
" Core ops (not exhaustive yet).
33-
" TODO: the list is not exhaustive.
34-
syn keyword mlirOps alloc alloca addf addi call call_indirect cmpf cmpi constant
35-
syn keyword mlirOps dealloc divf dma_start dma_wait dim extract_element
36-
syn keyword mlirOps getTensor index_cast load memref_cast memref_shape_cast
37-
syn keyword mlirOps mulf muli negf prefetch sitofp splat store select subf subi
38-
syn keyword mlirOps subview tensor_cast view
37+
" Standard dialect ops.
38+
" TODO: this list is not exhaustive.
39+
syn keyword mlirOps alloc alloca addf addi and call call_indirect cmpf cmpi
40+
syn keyword mlirOps constant dealloc divf dma_start dma_wait dim exp
41+
syn keyword mlirOps extract_element getTensor index_cast load log memref_cast
42+
syn keyword mlirOps memref_shape_cast mulf muli negf powf prefetch rsqrt sitofp
43+
syn keyword mlirOps splat store select sqrt subf subi subview tanh tensor_cast
44+
syn keyword mlirOps view
3945

4046
" Affine ops.
4147
syn match mlirOps /\<affine\.apply\>/
@@ -44,6 +50,7 @@ syn match mlirOps /\<affine\.dma_wait\>/
4450
syn match mlirOps /\<affine\.for\>/
4551
syn match mlirOps /\<affine\.if\>/
4652
syn match mlirOps /\<affine\.load\>/
53+
syn match mlirOps /\<affine\.parallel\>/
4754
syn match mlirOps /\<affine\.prefetch\>/
4855
syn match mlirOps /\<affine\.store\>/
4956
syn match mlirOps /\<loop\.for\>/

0 commit comments

Comments
 (0)