Index: lib/Target/AArch64/AArch64FastISel.cpp =================================================================== --- lib/Target/AArch64/AArch64FastISel.cpp +++ lib/Target/AArch64/AArch64FastISel.cpp @@ -3270,6 +3270,8 @@ return Len < 32; } +// FIXME: MemCpy intrinsic now provides separate alignments for source and +// dest. Enhance this function to exploit this. bool AArch64FastISel::tryEmitSmallMemCpy(Address Dest, Address Src, uint64_t Len, unsigned Alignment) { // Make sure we don't bloat code by inlining very large memcpy's. @@ -3457,7 +3459,8 @@ // Small memcpy's are common enough that we want to do them without a call // if possible. uint64_t Len = cast(MTI->getLength())->getZExtValue(); - unsigned Alignment = MTI->getAlignment(); + unsigned Alignment = MinAlign(MTI->getDestAlignment(), + MTI->getSourceAlignment()); if (isMemCpySmall(Len, Alignment)) { Address Dest, Src; if (!computeAddress(MTI->getRawDest(), Dest) ||