[ModRefInfo] Do not use ModRefInfo result in if conditions as this makes

assumptions about the values in the enum. Replace with wrapper returning
bool [NFC].

llvm-svn: 319949
This commit is contained in:
Alina Sbirlea 2017-12-06 19:56:37 +00:00
parent 5a5c1d1c69
commit 18fea013de
3 changed files with 5 additions and 3 deletions

View 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;
}

View 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;

View 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;