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

WIP evolving the IR #15181

Closed
wants to merge 4 commits into from
Closed

WIP evolving the IR #15181

wants to merge 4 commits into from

Conversation

JeffBezanson
Copy link
Member

This represents local variables as Slot(i) instead of symbols, making parts of the compiler simpler and hopefully faster. Also helps the interpreter.

Status: builds a working system image, but only with inlining disabled. Inlining pass seems not to fully work yet.

cc @vtjnash @carnaval

Remaining steps:

  • Get everything working with numbered slots
  • Convert varinfo from array-of-arrays to 3 arrays
  • Switch from Expr to compact types for assignment, return, gotoifnot, call{n}
  • Don't store mangled and compiler-generated symbol names in varinfo
  • A more efficient way to annotate uses of slots with types. There are too many Slot objects, and the vast majority ought to be shared like GenSyms are.

jl_svec_t *local_syms,
jl_svec_t *local_vals)
JL_DLLEXPORT jl_value_t *jl_interpret_toplevel_expr_in(jl_module_t *m, jl_value_t *e,
jl_lambda_info_t *lam)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to assume that local_vals == lam->sparam_vals, but that is false for the LambdaInfo reached at LambdaInfo->unspecialized and LambdaInfo)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, will add another argument for this.

@JeffBezanson JeffBezanson force-pushed the jb/linear branch 3 times, most recently from 1269902 to 2e1de81 Compare February 23, 2016 19:48
@iamed2
Copy link
Contributor

iamed2 commented Feb 23, 2016

Switch from Expr to compact types for assignment, return, gotoifnot, enter, leave, static_parameter

I'm excited for the macro dispatch opportunities this will provide!

@carnaval
Copy link
Contributor

this stage happens after the macro expansion

@carnaval
Copy link
Contributor

@JeffBezanson might that be a good time to also have varinfo be some kind of type with proper field names so that part of all the magic indices everywhere can go away ? not hugely important but might be a nicety along the way

@JeffBezanson
Copy link
Member Author

@carnaval Yes, that's on the list, but I was thinking of using 3 arrays indexed by slot number. That way the flags can be a UInt8 array.

@JeffBezanson
Copy link
Member Author

Ok, things are passing, except for one test where the interpreter doesn't yet know the names of local variables, which is expected. The system image build is about 50 seconds faster than master, so this is promising.

@timholy
Copy link
Member

timholy commented Mar 1, 2016

Wow, 50 seconds. Just fantastic work you folks are doing to improve the core infrastructure.

this avoids needing to repeatedly look up labels when interpreting or
analyzing code.
wrap static parameters with (static-parameter  )
start renaming `jlgensym` to `val` (ssa value)
@JeffBezanson JeffBezanson force-pushed the jb/linear branch 2 times, most recently from 6f1abd8 to 2119e87 Compare March 2, 2016 21:30
LambdaInfo.ast is now LambdaInfo.code, and is just an array of
statements

store LambdaInfo objects in the tfunc cache, instead of just ASTs

remove some arguments to jl_type_infer and typeinf
ensure every specialization has a new LambdaInfo; before we sometimes
  erroneously mutated the original LambdaInfo for a definition
@tkelman tkelman deleted the jb/linear branch March 10, 2016 10:10
@JeffBezanson JeffBezanson mentioned this pull request Mar 24, 2016
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.

5 participants