[PATCH] D136822: [InstCombine] Allow memcpys from constant memory to readonly noalias parameters to be elided.

Patrick Walton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 12:56:54 PDT 2022


pcwalton marked 5 inline comments as done.
pcwalton added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:94
+              Call->paramHasAttr(DataOpNo, Attribute::ReadOnly) &&
+              Call->paramHasAttr(DataOpNo, Attribute::NoAlias))) &&
             (Call->use_empty() || Call->doesNotCapture(DataOpNo)))
----------------
nikic wrote:
> Do we actually need the noalias requirement here? The code in this function should visit all uses of the alloca and bail out on any captures. So if there is a second argument based on the alloca that is not readonly, then we would reject it at that point. Does that sound right?
Good point! I'll remove that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136822



More information about the llvm-commits mailing list