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 tfunc for inserted isa/and calls #54209

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

topolarity
Copy link
Member

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.

For extended lattice elements, the type of the resulting PiNode can end
up imprecise when `tmeet(argextype(argex), mft) ⊑ mft`
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.
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")

Other optimization passes also have hardcoded native types, we might need to tweak them too in the future.

Copy link
Member

@Keno Keno left a comment

Choose a reason for hiding this comment

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

I am slightly unhappy about the extra overhead, but I'd rather have this correct first and look into putting fastpaths into the tfuncs later if necessary (if we new this was const in the base lattice, the compiler should be able to determine that as well, but of course, it may not be seeing all the constraints).

@vtjnash
Copy link
Member

vtjnash commented Apr 24, 2024

I think these are fairly trivial functions, especially as normal tfunc usage requires that constant always be handled before calling these

@Keno Keno merged commit c38e7cd into JuliaLang:master Apr 24, 2024
7 checks passed
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.

4 participants