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

enable/improve constant propagation through varargs methods #26826

Merged
merged 1 commit into from
May 4, 2018

Commits on May 4, 2018

  1. enable/improve constant propagation through varargs methods

    - Store varargs type information in the InferenceResult object, such that the info can be used during inference/optimization
    
    - Hack in a more precise return type for getfield of a vararg tuple. Ideally, we would handle this by teaching inference to track the types of the individual fields of a Tuple, which would make this unnecessary, but until then, this hack is helpful.
    
    - Spoof parents as well as children during recursion limiting, so that higher degree cycles are appropriately spoofed
    
    - A broadcast test marked as broken is now no longer broken, presumably due to the optimizations in this commit
    
    - Fix relationship between depth/mindepth in limit_type_size/is_derived_type. The relationship should have been inverse over the domain in which they overlap, but was not maintained consistently. An example of problematic case was:
    
    t = Tuple{X,X} where X<:Tuple{Tuple{Int64,Vararg{Int64,N} where N},Tuple{Int64,Vararg{Int64,N} where N}}
    c = Tuple{X,X} where X<:Tuple{Int64,Vararg{Int64,N} where N}
    
    because is_derived_type was computing the depth of usage rather than the depth of definition. This change thus makes the depth/mindepth calculations more consistent, and causes the limiting heuristic to return strictly wider types than it did before.
    
    - Move the optimizer's "varargs types to tuple type" rewrite to after cache lookup.Inference is populating the InferenceResult cache using the varargs form, so the optimizer needs to do the lookup before writing the atypes in order to avoid cache misses.
    
    Co-authored-by: Jameson Nash <[email protected]>
    Co-authored-by: Keno Fischer <[email protected]>
    3 people committed May 4, 2018
    Configuration menu
    Copy the full SHA
    b4b4d21 View commit details
    Browse the repository at this point in the history