-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
enumerate
allocates for arrays of mutables
#16190
Comments
This is due to the fact that currently types that contain mutable values must be heap-allocated and values that refer to heap-allocated values must themselves be heap allocated. This is essentially the same as #10899 and #14955 (which, afaict are dups of each other), has the same root cause as #1168 and would be addressed by #11714 or #12205. @carnaval, what's the status of stack-allocating objects that refer to the heap? Wasn't that one of the major goals of the Green Fairy work? |
This one doesn't need stack allocation to work. The type inference should be able to elide the allocation. This is one of the left over case in #16021 . |
Even better that we can solve this without needing to solve those other issues. |
Dup of #10899 and other similar issues |
Not a dup according to #23240 |
This allow us to handle certain object allocations with object reference fields. DSE is particularly useful on LLVM 5.0+ where we can take advantage of llvm store to load forwarding to delete objects that's only used as local buffer. This is also a prototype for the next gen optimization in type inference and to guide the new IR format necessary for it. Fix #16190
This allow us to handle certain object allocations with object reference fields. DSE is particularly useful on LLVM 5.0+ where we can take advantage of llvm store to load forwarding to delete objects that's only used as local buffer. This is also a prototype for the next gen optimization in type inference and to guide the new IR format necessary for it. Fix #16190
This allow us to handle certain object allocations with object reference fields. DSE is particularly useful on LLVM 5.0+ where we can take advantage of llvm store to load forwarding to delete objects that's only used as local buffer. This is also a prototype for the next gen optimization in type inference and to guide the new IR format necessary for it. Fix #16190
This allow us to handle certain object allocations with object reference fields. DSE is particularly useful on LLVM 5.0+ where we can take advantage of llvm store to load forwarding to delete objects that's only used as local buffer. This is also a prototype for the next gen optimization in type inference and to guide the new IR format necessary for it. Fix #16190
Using
enumerate
to iterate through array of mutable objects allocates, but using a simple for loop does not:results:
also, using
for obj in arr
rather thanenumerate
does not allocate.The text was updated successfully, but these errors were encountered: