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

inlining: Use tmeet on inserted PiNode types for extended lattices #54105

Merged
merged 1 commit into from Apr 23, 2024

Conversation

topolarity
Copy link
Member

For extended lattice elements, the type of the resulting PiNode can end up imprecise when tmeet(argextype(argex), mft) ⊑ mft

That said, it's not entirely clear to me what our IR_FLAG_REFINED obligations are in the first place. Are we supposed to mark any statements that are widened past what inference would have seen? If so, it seems like we fall far short of that.

@Keno
Copy link
Member

Keno commented Apr 16, 2024

I don't know if this makes sense. The type was not refined in the base lattice. I think the external absint may want to set this itself when doing the lattice extension.

@topolarity
Copy link
Member Author

In the case I hit this, we're running with an extended optimizer lattice where the input to the PiNode is already an extended element, so that the new type we insert does not end up being a subtype.

@topolarity topolarity marked this pull request as draft April 16, 2024 21:23
@topolarity topolarity marked this pull request as ready for review April 17, 2024 15:24
@topolarity topolarity changed the title inlining: Mark inserted PiNodes for refinement inlining: Use tmeet on inserted PiNode types for extended lattices Apr 17, 2024
Copy link
Sponsor Member

@aviatesk aviatesk left a comment

Choose a reason for hiding this comment

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

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

@aviatesk
Copy link
Sponsor Member

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

@nanosoldier
Copy link
Collaborator

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

@aviatesk
Copy link
Sponsor Member

The benchmark looks fine.

For extended lattice elements, the type of the resulting PiNode can end
up imprecise when `tmeet(argextype(argex), mft) ⊑ mft`
topolarity added a commit to topolarity/julia that referenced this pull request Apr 23, 2024
The motivation for this is the same as JuliaLang#54105, where the return types
being filled in by inference can in general be imprecise when running
the compiler with an extended lattice.

This PR is very incomplete - There are at least 6+ more places in
`inlining.jl` where we hard-code return types that will need similar
treatment.
topolarity added a commit to topolarity/julia that referenced this pull request Apr 23, 2024
The motivation for this is the same as JuliaLang#54105, where the return types
being filled in by inference can in general be imprecise when running
the compiler with an extended lattice.

This PR is very incomplete - There are at least 6+ more places in
`inlining.jl` where we hard-code return types that will need similar
treatment.
@topolarity topolarity added the merge me PR is reviewed. Merge when all tests are passing label Apr 23, 2024
@topolarity topolarity merged commit d645fed into JuliaLang:master Apr 23, 2024
8 checks passed
@fatteneder fatteneder removed the merge me PR is reviewed. Merge when all tests are passing label Apr 23, 2024
Keno pushed a commit that referenced this pull request Apr 24, 2024
The motivation for this is the same as #54105, where the return types
being filled in by inference can in general be imprecise when running
the compiler with an extended lattice.

Note that this PR is very incomplete.

There are at least 6+ more places in `inlining.jl` where we hard-code
return types that will need similar treatment, but for now this resolves
some downstream bugs from these imprecise types.
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.

None yet

5 participants