1) affineint (as it is named) is not a type suitable for general computation (e.g. the multiply/adds in an integer matmul). It has undefined width and is undefined on overflow. They are used as the indices for forstmt because they are intended to be used as indexes inside the loop. 2) It can be used in both cfg and ml functions, and in cfg functions. As you mention, “symbols” are not affine, and we use affineint values for symbols. 3) Integers aren’t affine, the algorithms applied to them can be. :) 4) The only suitable use for affineint in MLIR is for indexes and dimension sizes (i.e. the bounds of those indexes). PiperOrigin-RevId: 216057974
36 lines
1.0 KiB
VimL
36 lines
1.0 KiB
VimL
" Vim syntax file
|
|
" Language: MLIR
|
|
|
|
" quit when a syntax file was already loaded
|
|
if exists("b:current_syntax")
|
|
finish
|
|
endif
|
|
|
|
syn keyword mlirType index i1 i2 i4 i8 i13 i16 i32 i64
|
|
\ f16 f32 tf_control
|
|
syn keyword mlirType memref tensor vector
|
|
|
|
syntax keyword mlirKeywords extfunc cfgfunc mlfunc for to step return
|
|
syntax keyword mlirConditional if else
|
|
|
|
syn match mlirInt "-\=\<\d\+\>"
|
|
syn match mlirFloat "-\=\<\d\+\.\d\+\>"
|
|
syn match mlirMapOutline "#.*$"
|
|
syn match mlirOperator "[+\-*=]"
|
|
|
|
syn region mlirComment start="//" skip="\\$" end="$"
|
|
syn region mlirString matchgroup=mlirString start=+"+ end=+"+
|
|
|
|
hi def link mlirComment Comment
|
|
hi def link mlirKeywords Statement
|
|
hi def link mlirInt Constant
|
|
hi def link mlirType Type
|
|
hi def link mlirMapOutline PreProc
|
|
hi def link mlirConditional Conditional
|
|
hi def link mlirString String
|
|
hi def link mlirOperator Operator
|
|
hi def link mlirInstruction Operator
|
|
hi def link mlirAffineOp Operator
|
|
|
|
let b:current_syntax = "mlir"
|