[PATCH] D150970: (WIP) [MemCpyOpt]remove memcpy on noalias readonly attributed arguments

Kohei Asano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 19 08:00:19 PDT 2023


khei4 created this revision.
Herald added subscribers: jeroen.dobbelaere, JDevlieghere, hiraditya.
Herald added a project: All.
khei4 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

motivated to resolve https://github.com/rust-lang/rust/issues/107436

noalias readonly arguments is safely passed to function directly without memcpy


https://reviews.llvm.org/D150970

Files:
  llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp


Index: llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -1644,6 +1644,7 @@
         for (unsigned i = 0, e = CB->arg_size(); i != e; ++i)
           if (CB->isByValArgument(i))
             MadeChange |= processByValArgument(*CB, i);
+        /* else if (CB-> ) attributed with noalias readonly*/
       }
 
       // Reprocess the instruction if desired.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150970.523781.patch
Type: text/x-patch
Size: 527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230519/9c5d77ed/attachment.bin>


More information about the llvm-commits mailing list