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

Fix builtin_tfunction for Core._expr #37188

Merged
merged 1 commit into from
Aug 25, 2020
Merged

Fix builtin_tfunction for Core._expr #37188

merged 1 commit into from
Aug 25, 2020

Conversation

martinholters
Copy link
Member

This had no effect before, as Expr is not a Builtin, but Core._expr is.

Before:

julia> code_typed(Expr)
1-element Vector{Any}:
 CodeInfo(
1%1 = Core._apply_iterate(Core.iterate, Core._expr, args)::Any
└──      return %1
) => Any

After:

julia> code_typed(Expr)
1-element Vector{Any}:
 CodeInfo(
1%1 = Core._apply_iterate(Core.iterate, Core._expr, args)::Expr
└──      return %1
) => Expr

@martinholters martinholters added the compiler:inference Type inference label Aug 25, 2020
@martinholters
Copy link
Member Author

martinholters commented Aug 25, 2020

(Some interesting(?) archeology: I think this was missed in bec065f (#8712), so this is actually a fix to a regression ... introduced between 0.3 and 0.4 😄)

@JeffBezanson
Copy link
Sponsor Member

The if isva; return Any check in there is also pretty pessimistic, e.g.

julia> f(a...) = ===(a...)

julia> code_typed(f)
1-element Vector{Any}:
 CodeInfo(
1 ─ %1 = Core._apply_iterate(Base.iterate, Main.:(===), a)::Any
└──      return %1
) => Any

@JeffBezanson JeffBezanson merged commit 304efd9 into master Aug 25, 2020
@JeffBezanson JeffBezanson deleted the mh/expr-tfunc branch August 25, 2020 15:26
@martinholters
Copy link
Member Author

Yes, I had considered going further here, but this change was so obvious and seemed sufficiently beneficial considering Expr(:head, args...)-like constructs that I wanted to get it in before getting lost in some larger rework. But I now do have this on my mind...

simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants