mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
[ModRefInfo] Make enum ModRefInfo an enum class [NFC].
Summary: Make enum ModRefInfo an enum class. Changes to ModRefInfo values should be done using inline wrappers. This should prevent future bit-wise opearations from being added, which can be more error-prone. Reviewers: sanjoy, dberlin, hfinkel, george.burgess.iv Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40933 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320107 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -119,38 +119,38 @@ static ModRefInfo GetLocation(const Instruction *Inst, MemoryLocation &Loc,
|
||||
if (const LoadInst *LI = dyn_cast<LoadInst>(Inst)) {
|
||||
if (LI->isUnordered()) {
|
||||
Loc = MemoryLocation::get(LI);
|
||||
return MRI_Ref;
|
||||
return ModRefInfo::Ref;
|
||||
}
|
||||
if (LI->getOrdering() == AtomicOrdering::Monotonic) {
|
||||
Loc = MemoryLocation::get(LI);
|
||||
return MRI_ModRef;
|
||||
return ModRefInfo::ModRef;
|
||||
}
|
||||
Loc = MemoryLocation();
|
||||
return MRI_ModRef;
|
||||
return ModRefInfo::ModRef;
|
||||
}
|
||||
|
||||
if (const StoreInst *SI = dyn_cast<StoreInst>(Inst)) {
|
||||
if (SI->isUnordered()) {
|
||||
Loc = MemoryLocation::get(SI);
|
||||
return MRI_Mod;
|
||||
return ModRefInfo::Mod;
|
||||
}
|
||||
if (SI->getOrdering() == AtomicOrdering::Monotonic) {
|
||||
Loc = MemoryLocation::get(SI);
|
||||
return MRI_ModRef;
|
||||
return ModRefInfo::ModRef;
|
||||
}
|
||||
Loc = MemoryLocation();
|
||||
return MRI_ModRef;
|
||||
return ModRefInfo::ModRef;
|
||||
}
|
||||
|
||||
if (const VAArgInst *V = dyn_cast<VAArgInst>(Inst)) {
|
||||
Loc = MemoryLocation::get(V);
|
||||
return MRI_ModRef;
|
||||
return ModRefInfo::ModRef;
|
||||
}
|
||||
|
||||
if (const CallInst *CI = isFreeCall(Inst, &TLI)) {
|
||||
// calls to free() deallocate the entire structure
|
||||
Loc = MemoryLocation(CI->getArgOperand(0));
|
||||
return MRI_Mod;
|
||||
return ModRefInfo::Mod;
|
||||
}
|
||||
|
||||
if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(Inst)) {
|
||||
@@ -166,7 +166,7 @@ static ModRefInfo GetLocation(const Instruction *Inst, MemoryLocation &Loc,
|
||||
cast<ConstantInt>(II->getArgOperand(0))->getZExtValue(), AAInfo);
|
||||
// These intrinsics don't really modify the memory, but returning Mod
|
||||
// will allow them to be handled conservatively.
|
||||
return MRI_Mod;
|
||||
return ModRefInfo::Mod;
|
||||
case Intrinsic::invariant_end:
|
||||
II->getAAMetadata(AAInfo);
|
||||
Loc = MemoryLocation(
|
||||
@@ -174,7 +174,7 @@ static ModRefInfo GetLocation(const Instruction *Inst, MemoryLocation &Loc,
|
||||
cast<ConstantInt>(II->getArgOperand(1))->getZExtValue(), AAInfo);
|
||||
// These intrinsics don't really modify the memory, but returning Mod
|
||||
// will allow them to be handled conservatively.
|
||||
return MRI_Mod;
|
||||
return ModRefInfo::Mod;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -182,10 +182,10 @@ static ModRefInfo GetLocation(const Instruction *Inst, MemoryLocation &Loc,
|
||||
|
||||
// Otherwise, just do the coarse-grained thing that always works.
|
||||
if (Inst->mayWriteToMemory())
|
||||
return MRI_ModRef;
|
||||
return ModRefInfo::ModRef;
|
||||
if (Inst->mayReadFromMemory())
|
||||
return MRI_Ref;
|
||||
return MRI_NoModRef;
|
||||
return ModRefInfo::Ref;
|
||||
return ModRefInfo::NoModRef;
|
||||
}
|
||||
|
||||
/// Private helper for finding the local dependencies of a call site.
|
||||
@@ -689,12 +689,12 @@ MemDepResult MemoryDependenceResults::getSimplePointerDependencyFrom(
|
||||
if (isModAndRefSet(MR))
|
||||
MR = AA.callCapturesBefore(Inst, MemLoc, &DT, &OBB);
|
||||
switch (MR) {
|
||||
case MRI_NoModRef:
|
||||
case ModRefInfo::NoModRef:
|
||||
// If the call has no effect on the queried pointer, just ignore it.
|
||||
continue;
|
||||
case MRI_Mod:
|
||||
case ModRefInfo::Mod:
|
||||
return MemDepResult::getClobber(Inst);
|
||||
case MRI_Ref:
|
||||
case ModRefInfo::Ref:
|
||||
// If the call is known to never store to the pointer, and if this is a
|
||||
// load query, we can safely ignore it (scan past it).
|
||||
if (isLoad)
|
||||
|
||||
Reference in New Issue
Block a user