You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 7, 2022. It is now read-only.
10: Start converting MIR to SSA TIR. r=ltratt a=vext01
This change:
- Starts adding support for statements to TIR.
Only simple assignments are translated. Everything else is made into
an "unimplemented" statement. The plan is to keep going until the BF
interpreter has none of these.
- Does the first part of the SSA conversion, namely:
* Computes the dominance frontier.
* Inserts PHI nodes in the right place and for the correct TIR variables.
So what we get is a CFG with PHIs, but which is not yet in SSA. The
remaining step is to walk the dominator tree and assign each definition
of a variable with a new SSA variable name. That's yet another algorithm
from the Appel book. To keep PRs manageable, I think we should do that
as a separate PR.
Manual inspection of CFG graphs with assignments and PHIs shown
look good. Here's a couple of examples:
## example 1

## example 2

I'd like to add some tests to this code to try and weed out some early
bugs (I'm sure there will be some). This is likely to take me a little
while as I want to inspect how upstream does this kind of testing. I
want to avoid manually constructing MIRs and TIRs by hand if I can help
it.
Question: Currently PHI nodes are of arbitrary arity to make them easier
to read during development. We talked about having only binary PHIs. Is
that still what we want?
[There is a local ykpack Cargo path until we decide what to do with
PHIs arity]
Cheers.
Co-authored-by: Edd Barrett <vext01@gmail.com>
0 commit comments