mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
Modify ModRefInfo values using static inline method abstractions [NFC].
Summary: The aim is to make ModRefInfo checks and changes more intuitive and less error prone using inline methods that abstract the bit operations. Ideally ModRefInfo would become an enum class, but that change will require a wider set of changes into FunctionModRefBehavior. Reviewers: sanjoy, george.burgess.iv, dberlin, hfinkel Subscribers: nlopes, llvm-commits Differential Revision: https://reviews.llvm.org/D40749 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319821 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -211,8 +211,8 @@ bool AliasSet::aliasesPointer(const Value *Ptr, uint64_t Size,
|
||||
if (!UnknownInsts.empty()) {
|
||||
for (unsigned i = 0, e = UnknownInsts.size(); i != e; ++i)
|
||||
if (auto *Inst = getUnknownInst(i))
|
||||
if (AA.getModRefInfo(Inst, MemoryLocation(Ptr, Size, AAInfo)) !=
|
||||
MRI_NoModRef)
|
||||
if (isModOrRefSet(
|
||||
AA.getModRefInfo(Inst, MemoryLocation(Ptr, Size, AAInfo))))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -231,15 +231,15 @@ bool AliasSet::aliasesUnknownInst(const Instruction *Inst,
|
||||
for (unsigned i = 0, e = UnknownInsts.size(); i != e; ++i) {
|
||||
if (auto *UnknownInst = getUnknownInst(i)) {
|
||||
ImmutableCallSite C1(UnknownInst), C2(Inst);
|
||||
if (!C1 || !C2 || AA.getModRefInfo(C1, C2) != MRI_NoModRef ||
|
||||
AA.getModRefInfo(C2, C1) != MRI_NoModRef)
|
||||
if (!C1 || !C2 || isModOrRefSet(AA.getModRefInfo(C1, C2)) ||
|
||||
isModOrRefSet(AA.getModRefInfo(C2, C1)))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (iterator I = begin(), E = end(); I != E; ++I)
|
||||
if (AA.getModRefInfo(Inst, MemoryLocation(I.getPointer(), I.getSize(),
|
||||
I.getAAInfo())) != MRI_NoModRef)
|
||||
if (isModOrRefSet(AA.getModRefInfo(
|
||||
Inst, MemoryLocation(I.getPointer(), I.getSize(), I.getAAInfo()))))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -572,12 +572,11 @@ AliasSet &AliasSetTracker::mergeAllAliasSets() {
|
||||
AliasAnyAS->AliasAny = true;
|
||||
|
||||
for (auto Cur : ASVector) {
|
||||
|
||||
// If Cur was already forwarding, just forward to the new AS instead.
|
||||
AliasSet *FwdTo = Cur->Forward;
|
||||
if (FwdTo) {
|
||||
Cur->Forward = AliasAnyAS;
|
||||
AliasAnyAS->addRef();
|
||||
AliasAnyAS->addRef();
|
||||
FwdTo->dropRef(*this);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user