]> granicus.if.org Git - llvm/commitdiff
[ModRefInfo] Do not use ModRefInfo result in if conditions as this makes
authorAlina Sbirlea <asbirlea@google.com>
Wed, 6 Dec 2017 19:56:37 +0000 (19:56 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Wed, 6 Dec 2017 19:56:37 +0000 (19:56 +0000)
assumptions about the values in the enum. Replace with wrapper returning
bool [NFC].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319949 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/AliasAnalysis.cpp
lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
lib/Transforms/Scalar/LoopIdiomRecognize.cpp

index 97ea0fc40bd3cfc4cf9090b5e90efc6db3c72fc3..d9a40b17a1fd65cb44f4f7af280ac2c7d71b263e 100644 (file)
@@ -544,7 +544,7 @@ bool AAResults::canInstructionRangeModRef(const Instruction &I1,
   ++E;  // Convert from inclusive to exclusive range.
 
   for (; I != E; ++I) // Check every instruction in range
-    if (intersectModRef(getModRefInfo(&*I, Loc), Mode))
+    if (isModOrRefSet(intersectModRef(getModRefInfo(&*I, Loc), Mode)))
       return true;
   return false;
 }
index 0931eb8d8bfbc7581545b09b556723e94bdcb3ec..3eb4e7bc289e98697742ed75b33e48d28fc2599d 100644 (file)
@@ -1929,7 +1929,8 @@ mayLoopAccessLocation(Value *Ptr, ModRefInfo Access, Loop *L,
   for (auto *B : L->blocks())
     for (auto &I : *B)
       if (Ignored.count(&I) == 0 &&
-          intersectModRef(AA.getModRefInfo(&I, StoreLoc), Access))
+          isModOrRefSet(
+              intersectModRef(AA.getModRefInfo(&I, StoreLoc), Access)))
         return true;
 
   return false;
index 052ead8df3102b128e289ad5551617133f91ec55..786c636af1562517a03e300c0b8b134b00679031 100644 (file)
@@ -788,7 +788,8 @@ mayLoopAccessLocation(Value *Ptr, ModRefInfo Access, Loop *L,
        ++BI)
     for (Instruction &I : **BI)
       if (IgnoredStores.count(&I) == 0 &&
-          intersectModRef(AA.getModRefInfo(&I, StoreLoc), Access))
+          isModOrRefSet(
+              intersectModRef(AA.getModRefInfo(&I, StoreLoc), Access)))
         return true;
 
   return false;