[PATCH] D13992: [AliasAnalysis] Take into account readonly attribute for the function arguments

Igor Laevsky via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 14:39:58 PDT 2015


igor-laevsky added inline comments.

================
Comment at: include/llvm/Analysis/AliasAnalysis.h:758-759
@@ -757,2 +757,4 @@
   ModRefInfo getArgModRefInfo(ImmutableCallSite CS, unsigned ArgIdx) {
+    if (CS.paramHasAttr(ArgIdx + 1, Attribute::ReadOnly))
+      return MRI_Ref;
     return MRI_ModRef;
----------------
chandlerc wrote:
> No, the AA *base* clase should have zero logic.
> 
> See BasicAAResult for an implementation which does this (and many other things) to provide useful AA information.
Thanks. It appears that BasicAliasAnalysis does not do this. Please see the updated diff.


http://reviews.llvm.org/D13992





More information about the llvm-commits mailing list