-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Field ordering still causes extra memcpy #58082
Comments
The llvm bug is https://bugs.llvm.org/show_bug.cgi?id=40574 |
@nikic do you think you might be able to look at what's going wrong here? |
Issue still exists: https://godbolt.org/z/j6GEeo Not sure why SROA doesn't handle this. IR test case:
Now, even if I comment out the |
I think the problem here is that https://github.com/llvm/llvm-project/blob/b26c953f55d659ed5148f38e34716efb696b5016/llvm/lib/Transforms/Scalar/SROA.cpp#L559-L572 will always place all overlapping splittable slices into one partition, if there are no overlapping unsplittable slices. If we replace memset with a store (which is unsplittable), then we would create a new partition at the store boundary. I think that this code should be treating splittable slices that only overlap as subsets similarly to unsplittable slices. |
Generated code appears to have significantly regressed here:
|
SmallVec doesn't use We could probably close this. |
I believe there is a preference for adding codegen tests before these are closed. |
This is similar to #56356 except this time with more fields:
gives:
vs moving capacity to the end of the struct:
The problem is reproducible with C++ so I'll file a new llvm bug too.
The text was updated successfully, but these errors were encountered: