-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging updated MLIR grammar from mlir-vscode repo #1
base: master
Are you sure you want to change the base?
Conversation
This updated MLIR grammar file comes from the mlir-visualizer/mlir-vscode repo and adds support for: Affine Dialect, LLVM IR Dialect, TensorFlow Lite Dialect, Tile Dialect, gpu Dialect, nvvm Dialect, loop Dialect, and the vector Dialect
"name": "entity.name.function.mlir.tileFunctions" | ||
}, | ||
"CHECK": { | ||
"match": "(\/\/)\\s*(CHECK\\s*:|CHECK-\\w+\\s*:)(.*)$", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe "CHECK :" wouldn't trigger FileCheck (please verify) and so should ideally be marked as an error as it is very rarely intentional.
"include": "#CHECK" | ||
}, | ||
{ | ||
"include": "#llvmType" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we makes these into categories? E.g., include "#llvmDialect" here and then have llvmDialect include all of these to avoid a flat list here.
{ | ||
"include":"#comment" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find highlighting comments distracting and will be more fragile (comments are not intended to be well formed IR). Also an op in a comment is not an op, it is just a comment for the user, highlighting inside a comment would indicate these are the same semantically, while they are not.
Now an exception would be if we tried to mark code segments inside comments (e.g.,
// mlir // %10 = addi %0, %1 : i32 //
but that would be pretty cumbersome to do in the syntax and the utility for the complexity is uncertain).
Been a little busy but I'm still planning on working on this |
This updated MLIR grammar file comes from the mlir-visualizer/mlir-vscode repo. It adds support for: Affine Dialect, LLVM IR Dialect, TensorFlow Lite Dialect, Tile Dialect, gpu Dialect, nvvm Dialect, loop Dialect, and the vector Dialect.
The major additions are function name highlighting for the aforementioned dialects, highlighting keywords inside of CHECK comments, and additional data types (such as ui32).
Examples of changes (changes underlined in red summarize other changes in the file):
Affine with original grammar (before):
Affine with new grammar (after):
Tile before:
Tile after:
TensorFlow Lite before:
TensorFlow Lite after: