-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
use stmt instead of Instruction
in populate_def_use_map!
#56201
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
base: master
Are you sure you want to change the base?
Conversation
@aviatesk, could you maybe have a look at this? |
Yeah, I can take a look on this. Maybe tomorrow or so. |
Bump |
At least in my hands, the fix in this PR does indeed fix the problem, but it uncovers a separate issue at julia/Compiler/src/optimize.jl Lines 910 to 913 in 97c920d
The problem appears to be the following: as a side-effect of calling julia/Compiler/src/optimize.jl Line 869 in 97c920d
i.e. it counts ssa uses -- see here . Returning If this happens, it means that when In any case, one way to prevent this from happening is simply to not bail out early as part of calling a It makes sense that fixing I'm really struggling to generate a minimal reproducer for this -- I found this as part of my work on Mooncake.jl, and the example from which I figured out this behaviour involves a lot of algorithmically generated code, so isn't amenable to making a minimal reproducer. Does someone who knows more than me about this think that they have an obvious way to produce an minimal reproducer from this description? edit: (I've confirmed locally that just commenting out lines 910-913 solves the problem, and have yet to encounter any new problems resulting from this) edit2: there appear to be two more related places where uses can be missed. The first is another bailing-out-early example: julia/Compiler/src/optimize.jl Line 864 in 97c920d
The second is that it looks like this bit of code assumes that the boundscheck argument to various things must be a constant, when in fact it looks like it can also be an SSA: julia/Compiler/src/optimize.jl Line 834 in 97c920d
|
fixes #56193
I imagine this maybe needs a test but not sure how to properly unit test this without creating a full end-to-end test using
Base.code_ircode
and so on.