[llvm] [LowerMemIntrinsics] Use i8 GEPs in memcpy/memmove lowering (PR #112707)

Fabian Ritter via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 01:49:47 PDT 2024


================
@@ -49,11 +49,12 @@ void llvm::createMemCpyLoopKnownSize(
   assert((!AtomicElementSize || !LoopOpType->isVectorTy()) &&
          "Atomic memcpy lowering is not supported for vector operand type");
 
+  Type *Int8Type = Type::getInt8Ty(Ctx);
   unsigned LoopOpSize = DL.getTypeStoreSize(LoopOpType);
   assert((!AtomicElementSize || LoopOpSize % *AtomicElementSize == 0) &&
-      "Atomic memcpy lowering is not supported for selected operand size");
+         "Atomic memcpy lowering is not supported for selected operand size");
 
-  uint64_t LoopEndCount = CopyLen->getZExtValue() / LoopOpSize;
+  uint64_t LoopEndCount = (CopyLen->getZExtValue() / LoopOpSize) * LoopOpSize;
----------------
ritter-x2a wrote:

Indeed, I didn't know this one. Thanks! I adjusted the PR to use `alignDown` with c6fccdf902f11f2524a1cbaf05fe6dec2e429181.

https://github.com/llvm/llvm-project/pull/112707


More information about the llvm-commits mailing list