This patch improves the handling of pointer offset in GEP expressions where one argument is the base pointer.
isPointerOffset() is being used by memcpyopt where current code synthesizes consecutive 32 bytes stores to one store and two memset intrinsic calls.
With this patch, we convert the stores to one memset intrinsic.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I think this can be easily generalized even more to handle the case when both Ptr1 and Ptr2 are GEPs of some common base - replace getOffsetFromBase with getOffsetAndBase, check that the bases are the same, return the difference between offsets.
But this is fine at it is, LGTM.
Comment Actions
I totally agree with what eugenis said.
I added his comments to a TODO comment.
I will commit this version and may address the TODO later.
iteratively