[PATCH] D27034: [AliasAnalysis] Teach BasicAA about memcpy.
Hal Finkel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 1 17:11:33 PST 2016
hfinkel accepted this revision.
hfinkel added inline comments.
================
Comment at: lib/Analysis/BasicAliasAnalysis.cpp:777
+
+ if ((SrcAA = getBestAAResults().alias(MemoryLocation::getForSource(Inst),
+ Loc)) == MustAlias)
----------------
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?
Repository:
rL LLVM
https://reviews.llvm.org/D27034
More information about the llvm-commits
mailing list