Skip to content
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

Merged
merged 117 commits into from
Feb 8, 2021
Merged

Document the IR. #357

merged 117 commits into from
Feb 8, 2021

Conversation

plietar
Copy link
Contributor

@plietar plietar commented Nov 23, 2020

No description provided.

Copy link
Contributor

@rengolin rengolin left a 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 Show resolved Hide resolved
src/compiler/ir/README.md Outdated Show resolved Hide resolved
src/compiler/ir/README.md Outdated Show resolved Hide resolved
src/compiler/ir/README.md Outdated Show resolved Hide resolved
src/compiler/ir/README.md Outdated Show resolved Hide resolved
src/compiler/ir/README.md Outdated Show resolved Hide resolved
src/compiler/ir/README.md Outdated Show resolved Hide resolved
src/compiler/ir/README.md Outdated Show resolved Hide resolved
src/compiler/ir/README.md Outdated Show resolved Hide resolved
src/compiler/ir/README.md Outdated Show resolved Hide resolved
```
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
Copy link
Contributor Author

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.

Copy link
Member

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.

if (y->rt::Object::get_class() == RegionMD::ISO)
y_region = y
else
y_region = x_region
Copy link
Contributor Author

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?

Copy link
Member

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.

plietar and others added 2 commits December 3, 2020 12:36
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.
@rengolin
Copy link
Contributor

rengolin commented Dec 7, 2020

Just noticed, this PR has an LLVM update. Probably a left-over of some other branch, but we need to clear that before merge.

mjp41 and others added 2 commits December 7, 2020 13:19
* 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.
plietar and others added 5 commits December 9, 2020 01:45
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.
src/compiler/ir/README.md Outdated Show resolved Hide resolved
src/compiler/ir/README.md Outdated Show resolved Hide resolved
plietar and others added 6 commits December 10, 2020 14:02
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.
docs/internal/1IR.md Outdated Show resolved Hide resolved
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.
@rengolin
Copy link
Contributor

rengolin commented Feb 7, 2021

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.

@rengolin rengolin marked this pull request as ready for review February 8, 2021 16:01
Copy link
Contributor

@rengolin rengolin left a 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.

@rengolin rengolin merged commit 73f340b into microsoft:master Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants