[all-commits] [llvm/llvm-project] 2afe67: [MemCpyOpt] Allow memcpy elision for non-noalias a...

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Sep 11 01:04:59 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2afe678f0a246387977a8ca694d4489e2c868991
      https://github.com/llvm/llvm-project/commit/2afe678f0a246387977a8ca694d4489e2c868991
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-09-11 (Wed, 11 Sep 2024)

  Changed paths:
    M llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
    M llvm/test/Transforms/MemCpyOpt/memcpy.ll

  Log Message:
  -----------
  [MemCpyOpt] Allow memcpy elision for non-noalias arguments (#107860)

We currently elide memcpys for readonly nocapture noalias arguments.
noalias is checked to make sure that there are no other ways to write
the memory, e.g. through a different argument or an escaped pointer.

In addition to the current noalias check, also query alias analysis, in
case it can prove that modification is not possible through other means.

This fixes the problem reported in
https://discourse.llvm.org/t/problem-about-memcpy-elimination/81121.



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