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

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 14:13:33 PDT 2015


chandlerc 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;
----------------
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.


http://reviews.llvm.org/D13992





More information about the llvm-commits mailing list