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

Compiler: abstract calls: type assert to help stability #57582

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nsajko
Copy link
Contributor

@nsajko nsajko commented Feb 28, 2025

It seems la is getting inferred as Integer instead of as Int for some reason.

This reduces the number of invalidations from 2061 to 2046 on running this code:

struct I <: Integer end
Base.Int64(::I) = 7

It seems `la` is getting inferred as `Integer` instead of as `Int` for
some reason.

This reduces the number of invalidations from 2061 to 2046 on running
this code:

```julia
struct I <: Integer end
Base.Int64(::I) = 7
```
@nsajko
Copy link
Contributor Author

nsajko commented Feb 28, 2025

This reminds me of PR #55583 😄

Another thing I tried, apart from just type asserting, is replacing the line (; fargs, argtypes) = arginfo with:

fargs = arginfo.fargs
argtypes = arginfo.argtypes

However that didn't help.

@JeffBezanson
Copy link
Member

Huh, this is strange. It's just a Vector{Any}; we should figure out why it can't infer length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants