-
Notifications
You must be signed in to change notification settings - Fork 162
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
"referenced after being consumed" ICE #1947
Comments
Minor simplification (mostly to avoid the compiler hypothetically optimising everything away): def consume (a: *[]i64) = a with [0] = 0
entry test (a: *[2]i64) (_: i64) n =
let b = map id a :> [n]i64
let a_consumed = consume a
let final = consume (copy (filter (\x -> x > 2) a_consumed))
in (all (\x -> x == 0) b, final) |
Ah, I see. The LiftAllocations pass does not properly take consumption into account when reordering code. Should be easy to fix. |
Want me to take a look? |
No need, I can do it. |
razetime
pushed a commit
to razetime/futhark
that referenced
this issue
May 27, 2023
The most invasive change was to make LiftAllocations take aliasing into account. I also generally refactored it a bit to further reduce duplication. I suspect a similar bug lurks in LowerAllocations.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tested this bug on
0.24.3
ande82e4c2
(latest commit). I'm sorry it's more complex/weird than usual, everytime I try to simplify it more, the issue goes away:Error:
The text was updated successfully, but these errors were encountered: