[PATCH] D27034: [AliasAnalysis] Teach BasicAA about memcpy.

bryant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 07:58:43 PST 2016


bryant added inline comments.


================
Comment at: lib/Analysis/BasicAliasAnalysis.cpp:777
+
+    if ((SrcAA = getBestAAResults().alias(MemoryLocation::getForSource(Inst),
+                                          Loc)) == MustAlias)
----------------
hfinkel wrote:
> Please add a comment here explaining why you can return MRI_Ref without even checking the destination (i.e. that you're relying on the memcpy semantics which forbid overlapping memory). With that, this LGTM.
> 
> We really should also add similar logic here for memmove and memset. Would you do this as follow-up?
> 
> We really should also add similar logic here for memmove and memset. Would you do this as follow-up?

Sure, but memmove permits source and destination to overlap, and memset splats a constant onto a destination. What sort of similar logic did you have in mind?


Repository:
  rL LLVM

https://reviews.llvm.org/D27034





More information about the llvm-commits mailing list