-
Notifications
You must be signed in to change notification settings - Fork 165
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
Document the IR. #357
Document the IR. #357
Conversation
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.
Thanks for this document, it really helps me understand the low level semantics of the language, many of which I was still missing.
I have added a few inline comments that are most for my own education. Some are related to MLIR lowering, but others may be ambiguity on the document and could lead to adding a bit more context.
But otherwise, looking great, thanks!
src/compiler/ir/README.md
Outdated
``` | ||
will guarantee that `y` is not an `iso` by adding coercions to | ||
`mut` such that all accesses in a function will determine they | ||
are part of the same region |
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.
This isn’t actually true today. That code, with y: iso
will pass the typechecker. Of course we can change that in the future.
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.
Yeah, sorry that was more how I was thinking it should be, not how it is.
src/compiler/ir/README.md
Outdated
if (y->rt::Object::get_class() == RegionMD::ISO) | ||
y_region = y | ||
else | ||
y_region = x_region |
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.
This needs x_region to not be null as well, just like the allocation stuff further down.
Why did you go with the region is null, rather than tagging the low bits as you’d mention previously?
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 like the idea of using the front-end to separate out allocation on an iso
reference from mut
, and then this seemed cleaner.
We can put the alternative in.
For every interface, codegen emits the list of subtypes. During matching, rather than requiring strict equality of descriptors, we search through the subtypes of the match type looking for the descriptor of the object being matched on.
Just noticed, this PR has an LLVM update. Probably a left-over of some other branch, but we need to clear that before merge. |
* NFC: Refactoring header includes. This is reducing the dependence on compiler/ast.h as ground work for switching to the new parser.
…t#362) This adds support for matching on primitives (cown, string, U64), capabilities, and union/intersection types. This is done by: - Turning String into a primitive, rather than being hardcoded in the compiler - Add a MatchCapability opcode to the VM. The existing Match opcode is renamed to MatchDescriptor. - Use a TypeVisitor to explore the match pattern, and using boolean operators to decompose complex types.
This produces the exact same behaviour, only it makes use of an existing higher abstraction.
They aren't used anywhere. `mark_pending` was identical to `set_pending` anyway, which does get used. In practice, `unmark_pending` is actually done with the `set_atomic`/`set_scc` methods.
This should be automatically rendered by GitHub Pages at: https://microsoft.github.io/verona You can test it locally by installing the github-pages gem and running `jekyll serve` in the docs directory. To make sure relative links work, run `jekyll serve -b /verona`.
Make testing part of top-level build to simplify use of some scripts such as update-dump. Also, gives nicer experience for running individual tests.
This causes a compiler error when attempting to use the forall method. I think the keyword was a leftover from a previous version, where the apply function was passed as a template parameter.
- Some of the comments were incorrectly copy/pasted - No need to use `grep -v` when we can get git to do the exclude for us.
For some reason cmake couldn't find OutputCheck, but switching to Python 3 fixes it. I don't understand what was going on but this is probably not a bad move anyway. Linux and Windows' pip binaries point to pip3 already, no need to change anything.
The emit method's signature is deduced from the same opcode spec which drives instruction decoding. This ensures instructions are written in a format which is consistent with.
* Refactor CMake * Makes a top-level approach of supplying your own installation * Makes the previous recursive approach now just submodules. * Applies some of Paul Lietar's refactorings * Minor tidying. * Improve passing variables to subproject.
This describes some of the passes that we want to run on MLIR. The idea of this document is to make sure our expectactions for passes and structure of the IR are compatible. Stealing some of David's comments here and there to make the document more accurate.
Using Ninja to build on Windows.
Hey, I know these are incomplete, but can we just merge this with a TODO on the missing parts and fill them up later? There's no point in keeping a documentation PR waiting for more content, when we can add it on following PRs. |
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 have rebased and added a TODO on the terminators, the only part that was missing, I think.
No description provided.