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

Kohei Asano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 22 01:23:59 PDT 2023


khei4 planned changes to this revision.
khei4 added a comment.

@nikic Thank you for the review! They saved me!



================
Comment at: llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp:1755
+              if (!CB->getParamAttr(i, Kind).isValid() &&
+                  !F->hasParamAttribute(i, Kind))
+                continue;
----------------
nikic wrote:
> `CB->paramHasAttr(i, Kind)` is enough, it will handle attribute inheritance.
Thank you for saving me! I haven't found the attribute inheritance behavior and am confused about that! 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150970/new/

https://reviews.llvm.org/D150970



More information about the llvm-commits mailing list