-
Notifications
You must be signed in to change notification settings - Fork 13
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
New SSA IR #5
Comments
Since we're immediately throwing out the SSA values themselves anyway, I expect this will be easy to update if it does change. The main change on 0.7 is linear IR, but I think even that'll work without any changes on our end. |
Phi nodes was a complication I was worried about, but maybe those can be thrown out, too. |
Even with phi nodes it should be straightforward to turn them into locals. We'll probably want some way to coalesce and/or remove locals entirely to clean up the code, which is a little harder, but tools like Binaryen will also do that for us for now. |
Quick example to give a flavour of what this looks like on 0.7: julia> function pow(x, n)
r = 1
while n > 0
r *= x
n -= 1
end
return r
end
pow (generic function with 1 method)
julia> @code_ir pow(1,2)
Code
1 ─ nothing
2 ┄ %2 = φ (1 => 1, 3 => %6)::Int64
│ %3 = φ (1 => %%3, 3 => %7)::Int64
│ %4 = Main.:>(%3, 0)::Bool
└── goto 4 if not %4
3 ─ %6 = Main.:*(%2, %%2)::Int64
│ %7 = Main.:-(%3, 1)::Int64
└── goto 2
4 ─ return %2 |
Does anyone know if Keno's new SSA IR will change the output of
code_typed
? I thought it might, but I haven't been able to figure that out.If it does, it's something to keep track of here.
The text was updated successfully, but these errors were encountered: