-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Invalid lifetime intrinsic after MemCpyOpt #66403
Comments
cc @nikic |
@vitalybuka @joanahalili
I'll reduce this case. |
This is the reduced problematic case. The
So, before inserting Moreover, to avoid the lifetime marker dropping, we can insert
Then, we can keep a lifetime range like the above. These can be obtained by calculating each leaf for memory location uses. |
This is followup to https://reviews.llvm.org/D155406
Here is reproducer for issues caused revert e0f9cc7.
Thanks to @joanahalili for reproducer.
Cpp: https://gist.github.com/vitalybuka/b6361a44762ad3cf0c3e7ce47a09512f
IR before transformation: https://gist.github.com/vitalybuka/86a2bdc17d8e074da8839baacea4ec94
So the transformation eliminates 2 allocas and keeps %ref.tmp5.
Before transofmation: %ref.tmp5 was alive for the loop on "cont.i12".
But after transfomration we start lifetime of tmp5 at _ZN3vecILj3EdEC2Ed.exit:
and end lifetime inside of the loop cont4.i:
And the next iteration of the loop will be bad.
The text was updated successfully, but these errors were encountered: