[llvm] r259179 - Minor bugfix in AAResults::getModRefInfo.

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 23:51:15 PST 2016

Author: gbiv
Date: Fri Jan 29 01:51:15 2016
New Revision: 259179

URL: http://llvm.org/viewvc/llvm-project?rev=259179&view=rev
Minor bugfix in AAResults::getModRefInfo.

Also removed a few redundant `else`s.

Bug was found by a test I wrote for MemorySSA (in review at
http://reviews.llvm.org/D7864; shiny update coming soon). So, assuming
that lands at some point, this should be covered by that. If anyone
feels this deserves its own explicit test case, please let me know.
I'll write one.


Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=259179&r1=259178&r2=259179&view=diff
--- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Fri Jan 29 01:51:15 2016
@@ -450,11 +450,11 @@ public:
   ModRefInfo getModRefInfo(const Instruction *I) {
     if (auto CS = ImmutableCallSite(I)) {
       auto MRB = getModRefBehavior(CS);
-      if (MRB & MRI_ModRef)
+      if ((MRB & MRI_ModRef) == MRI_ModRef)
         return MRI_ModRef;
-      else if (MRB & MRI_Ref)
+      if (MRB & MRI_Ref)
         return MRI_Ref;
-      else if (MRB & MRI_Mod)
+      if (MRB & MRI_Mod)
         return MRI_Mod;
       return MRI_NoModRef;

More information about the llvm-commits mailing list