Skip to content

Better lowering for inner constructors #44654

Closed
@Keno

Description

@Keno

Consider:

julia> code_lowered(Val{1}, Tuple{})
1-element Vector{Core.CodeInfo}:
 CodeInfo(
1 ─ %1 = Core.apply_type(Base.Val, $(Expr(:static_parameter, 1)))
│   %2 = %new(%1)
└──      return %2
)

A better lowering would be new(_1), since that would save the extra apply_type and save some inference time. Even better if signature itself doesn't have a static parameter anymore, since inference is more comfortable with that.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions