Skip to content

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.

@topolarity topolarity requested review from Keno and aviatesk April 16, 2024 19:08
@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
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
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
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
@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.

5 participants