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

Type inference opt passes clean up #18260

Merged
merged 7 commits into from
Sep 2, 2016
Merged

Type inference opt passes clean up #18260

merged 7 commits into from
Sep 2, 2016

Conversation

yuyichao
Copy link
Contributor

@yuyichao yuyichao commented Aug 27, 2016

These are the parts that are not related to coverage from #18196. The changes included in the PR are,

  • Make sure inlining cost model is insensitive to meta nodes and closer to the toplevel model in codegen.
  • Fix the cases where the label number doesn't match the statement index
  • Pop propagate_inbounds to LambdaInfo
  • Clean up some void use of variable to help allocation elim pass
  • Move handling of custom boundscheck elimination to type inference in order to reduce the AST size
  • Fix incorrect deletion of Expr(:inbounds, false) (This increases the AST size by a little since some of the nodes were incorrectly deleted.)

Overall this shrink the rodata size by 1-2%.

The last commit is some debugging/verifying code and will be removed before merging.

@nanosoldier runbenchmarks(ALL, vs = ":master")

@yuyichao yuyichao added compiler:codegen Generation of LLVM IR and native code compiler:inference Type inference labels Aug 27, 2016
@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

@yuyichao yuyichao force-pushed the yyc/typeinf/reduce branch 2 times, most recently from b52f5f7 to cc1c3e0 Compare August 28, 2016 03:37
function meta_elim_pass!(linfo::LambdaInfo, code::Array{Any,1})
# 1. Remove place holders
#
# 2. If coverage is off, remove line number nodes that doesn't mark any
Copy link
Contributor

Choose a reason for hiding this comment

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

don't

@yuyichao yuyichao force-pushed the yyc/typeinf/reduce branch 2 times, most recently from e82a28b to f2b94c6 Compare August 31, 2016 10:23
@yuyichao
Copy link
Contributor Author

yuyichao commented Sep 1, 2016

comment?

return false
elseif isa(ex, Slot)
return linfo.slotflags[(ex::Slot).id] & Slot_UsedUndef != 0
elseif (isa(ex, Expr) || isa(ex, GotoNode) || isa(ex, LineNumberNode) ||
Copy link
Member

Choose a reason for hiding this comment

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

Can we also remove GlobalRefs that are known to be defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure and done.

I somehow thought it was already handled in type inference but seems that I was testing the wrong thing....

Consistently ignore line numbers and metadata nodes in all cases.
Move unexported `jl_sym_t*` GVs from `julia.h` to `julia_internal.h`
@JeffBezanson
Copy link
Member

LGTM!

@yuyichao
Copy link
Contributor Author

yuyichao commented Sep 1, 2016

I've rebased this for a few time and it seems that there's always a saving in the sysimg size although the percentage can be as small as 0.5% or as big as 3%....

@yuyichao
Copy link
Contributor Author

yuyichao commented Sep 2, 2016

@nanosoldier runbenchmarks(ALL, vs = ":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

@yuyichao yuyichao merged commit 40c0fc6 into master Sep 2, 2016
@yuyichao yuyichao deleted the yyc/typeinf/reduce branch September 2, 2016 15:28
@blakejohnson
Copy link
Contributor

This looks good to me. The only issue I have is that it is now rather opaque as to where bounds check elimination happens. i.e. I wouldn't intuitively guess that I should look at the "meta elimination pass" to also find bounds check elimination. Perhaps that can be fixed with a better name for the function meta_elim_pass!, since it now does a lot more than remove meta information.

@StefanKarpinski
Copy link
Member

Is this still backportable if it proves stable or have we diverged too much already?

@yuyichao
Copy link
Contributor Author

yuyichao commented Sep 6, 2016

This is mainly a clean up for #18196 and both should be backportable after tested and if really wanted.

@yuyichao
Copy link
Contributor Author

yuyichao commented Sep 8, 2016

In case this is going to be backported, #18414 should be too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants