You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[LowerMemIntrinsics] Use i8 GEPs in memcpy/memmove lowering
The IR lowering of memcpy/memmove intrinsics uses a target-specific type for
its load/store operations. So far, the loaded and stored addresses are computed
with GEPs based on this type. That is wrong if the allocation size of the type
differs from its store size: The width of the accesses is determined by the
store size, while the GEP stride is determined by the allocation size. If the
allocation size is greater than the store size, some bytes are not
copied/moved.
This patch changes the GEPs to use i8 addressing, with offsets based on the
type's store size. The correctness of the lowering therefore no longer depends
on the type's allocation size.
This is in support of PR llvm#112332, which allows adjusting the memcpy loop
lowering type through a command line argument in the AMDGPU backend.
0 commit comments