[all-commits] [llvm/llvm-project] 6c84bb: [LowerMemIntrinsics] Use correct alignment in resi...

Fabian Ritter via All-commits all-commits at lists.llvm.org
Wed Jul 10 02:29:48 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6c84bba218f7b64f2257405ac30a3c6948df8373
      https://github.com/llvm/llvm-project/commit/6c84bba218f7b64f2257405ac30a3c6948df8373
  Author: Fabian Ritter <fabian.ritter at amd.com>
  Date:   2024-07-10 (Wed, 10 Jul 2024)

  Changed paths:
    M llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp
    M llvm/test/CodeGen/AMDGPU/lower-mem-intrinsics.ll

  Log Message:
  -----------
  [LowerMemIntrinsics] Use correct alignment in residual loop for variable llvm.memcpy (#97998)

Memcpy intrinsics with statically unknown loop sizes are lowered with
two load/store loops: one with access widths specified by the target,
and a residual loop that copies remaining bytes individually.

As the residual loop operates byte-wise, its accesses are only
1-aligned. However, we currently use the alignment that is optimal for
the first loop in both, which is unsound. With this patch, we use the
correct alignment in the residual loop.

The lowering of memcpy with a static size already handles alignments for
the residual correctly.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list