Skip to content

Commit

Permalink
[ModRefInfo] Replace remaining bit-wise operations with wrappers.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319993 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
alinas committed Dec 7, 2017
1 parent 113753f commit 9c87911
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Analysis/BasicAliasAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ ModRefInfo BasicAAResult::getModRefInfo(ImmutableCallSite CS,
}

// Early return if we improved mod ref information
if (Result != MRI_ModRef)
if (!isModAndRefSet(Result))
return Result;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/Analysis/GlobalsModRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class GlobalsAAResult::FunctionInfo {
if (AlignedMap *P = Info.getPointer()) {
auto I = P->Map.find(&GV);
if (I != P->Map.end())
GlobalMRI = ModRefInfo(GlobalMRI | I->second);
GlobalMRI = unionModRef(GlobalMRI, I->second);
}
return GlobalMRI;
}
Expand All @@ -174,7 +174,7 @@ class GlobalsAAResult::FunctionInfo {
Info.setPointer(P);
}
auto &GlobalMRI = P->Map[&GV];
GlobalMRI = ModRefInfo(GlobalMRI | NewMRI);
GlobalMRI = unionModRef(GlobalMRI, NewMRI);
}

/// Clear a global's ModRef info. Should be used when a global is being
Expand Down Expand Up @@ -570,7 +570,7 @@ void GlobalsAAResult::AnalyzeCallGraph(CallGraph &CG, Module &M) {
if (Callee->isIntrinsic()) {
FunctionModRefBehavior Behaviour =
AAResultBase::getModRefBehavior(Callee);
FI.addModRefInfo(ModRefInfo(Behaviour & MRI_ModRef));
FI.addModRefInfo(createModRefInfo(Behaviour));
}
}
continue;
Expand Down
2 changes: 1 addition & 1 deletion lib/Analysis/MemoryDependenceAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ MemDepResult MemoryDependenceResults::getDependency(Instruction *QueryInst) {
ModRefInfo MR = GetLocation(QueryInst, MemLoc, TLI);
if (MemLoc.Ptr) {
// If we can do a pointer scan, make it happen.
bool isLoad = !(MR & MRI_Mod);
bool isLoad = !isModSet(MR);
if (auto *II = dyn_cast<IntrinsicInst>(QueryInst))
isLoad |= II->getIntrinsicID() == Intrinsic::lifetime_start;

Expand Down

0 comments on commit 9c87911

Please sign in to comment.