.. code-block:: c++
- AliasAnalysis::AliasResult alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size) {
+ AliasResult alias(const Value *V1, unsigned V1Size,
+ const Value *V2, unsigned V2Size) {
if (...)
return NoAlias;
...
class MemIntrinsic;
class DominatorTree;
+/// The possible results of an alias query.
+///
+/// These results are always computed between two MemoryLocation objects as
+/// a query to some alias analysis.
+///
+/// Note that these are unscoped enumerations because we would like to support
+/// implicitly testing a result for the existence of any possible aliasing with
+/// a conversion to bool, but an "enum class" doesn't support this. The
+/// canonical names from the literature are suffixed and unique anyways, and so
+/// they serve as global constants in LLVM for these results.
+///
+/// See docs/AliasAnalysis.html for more information on the specific meanings
+/// of these values.
+enum AliasResult {
+ /// The two locations do not alias at all.
+ ///
+ /// This value is arranged to convert to false, while all other values
+ /// convert to true. This allows a boolean context to convert the result to
+ /// a binary flag indicating whether there is the possibility of aliasing.
+ NoAlias = 0,
+ /// The two locations may or may not alias. This is the least precise result.
+ MayAlias,
+ /// The two locations alias, but only due to a partial overlap.
+ PartialAlias,
+ /// The two locations precisely alias each other.
+ MustAlias,
+};
+
class AliasAnalysis {
protected:
const DataLayout *DL;
/// Alias Queries...
///
- /// Alias analysis result - Either we know for sure that it does not alias, we
- /// know for sure it must alias, or we don't know anything: The two pointers
- /// _might_ alias. This enum is designed so you can do things like:
- /// if (AA.alias(P1, P2)) { ... }
- /// to check to see if two pointers might alias.
- ///
- /// See docs/AliasAnalysis.html for more information on the specific meanings
- /// of these values.
- ///
- enum AliasResult {
- NoAlias = 0, ///< No dependencies.
- MayAlias, ///< Anything goes.
- PartialAlias, ///< Pointers differ, but pointees overlap.
- MustAlias ///< Pointers are equal.
- };
-
/// alias - The main low level interface to the alias analysis implementation.
/// Returns an AliasResult indicating whether the two pointers are aliased to
/// each other. This is the interface that must be implemented by specific
// Default chaining methods
//===----------------------------------------------------------------------===//
-AliasAnalysis::AliasResult AliasAnalysis::alias(const MemoryLocation &LocA,
- const MemoryLocation &LocB) {
+AliasResult AliasAnalysis::alias(const MemoryLocation &LocA,
+ const MemoryLocation &LocB) {
assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
return AA->alias(LocA, LocB);
}
return new AliasAnalysisCounter();
}
-AliasAnalysis::AliasResult
-AliasAnalysisCounter::alias(const MemoryLocation &LocA,
- const MemoryLocation &LocB) {
+AliasResult AliasAnalysisCounter::alias(const MemoryLocation &LocA,
+ const MemoryLocation &LocB) {
AliasResult R = getAnalysis<AliasAnalysis>().alias(LocA, LocB);
const char *AliasString = nullptr;
if (I2ElTy->isSized()) I2Size = AA.getTypeStoreSize(I2ElTy);
switch (AA.alias(*I1, I1Size, *I2, I2Size)) {
- case AliasAnalysis::NoAlias:
+ case NoAlias:
PrintResults("NoAlias", PrintNoAlias, *I1, *I2, F.getParent());
++NoAliasCount;
break;
- case AliasAnalysis::MayAlias:
+ case MayAlias:
PrintResults("MayAlias", PrintMayAlias, *I1, *I2, F.getParent());
++MayAliasCount;
break;
- case AliasAnalysis::PartialAlias:
+ case PartialAlias:
PrintResults("PartialAlias", PrintPartialAlias, *I1, *I2,
F.getParent());
++PartialAliasCount;
break;
- case AliasAnalysis::MustAlias:
+ case MustAlias:
PrintResults("MustAlias", PrintMustAlias, *I1, *I2, F.getParent());
++MustAliasCount;
break;
I2 != E2; ++I2) {
switch (AA.alias(MemoryLocation::get(cast<LoadInst>(*I1)),
MemoryLocation::get(cast<StoreInst>(*I2)))) {
- case AliasAnalysis::NoAlias:
+ case NoAlias:
PrintLoadStoreResults("NoAlias", PrintNoAlias, *I1, *I2,
F.getParent());
++NoAliasCount;
break;
- case AliasAnalysis::MayAlias:
+ case MayAlias:
PrintLoadStoreResults("MayAlias", PrintMayAlias, *I1, *I2,
F.getParent());
++MayAliasCount;
break;
- case AliasAnalysis::PartialAlias:
+ case PartialAlias:
PrintLoadStoreResults("PartialAlias", PrintPartialAlias, *I1, *I2,
F.getParent());
++PartialAliasCount;
break;
- case AliasAnalysis::MustAlias:
+ case MustAlias:
PrintLoadStoreResults("MustAlias", PrintMustAlias, *I1, *I2,
F.getParent());
++MustAliasCount;
for (SetVector<Value *>::iterator I2 = Stores.begin(); I2 != I1; ++I2) {
switch (AA.alias(MemoryLocation::get(cast<StoreInst>(*I1)),
MemoryLocation::get(cast<StoreInst>(*I2)))) {
- case AliasAnalysis::NoAlias:
+ case NoAlias:
PrintLoadStoreResults("NoAlias", PrintNoAlias, *I1, *I2,
F.getParent());
++NoAliasCount;
break;
- case AliasAnalysis::MayAlias:
+ case MayAlias:
PrintLoadStoreResults("MayAlias", PrintMayAlias, *I1, *I2,
F.getParent());
++MayAliasCount;
break;
- case AliasAnalysis::PartialAlias:
+ case PartialAlias:
PrintLoadStoreResults("PartialAlias", PrintPartialAlias, *I1, *I2,
F.getParent());
++PartialAliasCount;
break;
- case AliasAnalysis::MustAlias:
+ case MustAlias:
PrintLoadStoreResults("MustAlias", PrintMustAlias, *I1, *I2,
F.getParent());
++MustAliasCount;
// If the pointers are not a must-alias pair, this set becomes a may alias.
if (AA.alias(MemoryLocation(L->getValue(), L->getSize(), L->getAAInfo()),
MemoryLocation(R->getValue(), R->getSize(), R->getAAInfo())) !=
- AliasAnalysis::MustAlias)
+ MustAlias)
Alias = SetMayAlias;
}
if (isMustAlias() && !KnownMustAlias)
if (PointerRec *P = getSomePointer()) {
AliasAnalysis &AA = AST.getAliasAnalysis();
- AliasAnalysis::AliasResult Result =
+ AliasResult Result =
AA.alias(MemoryLocation(P->getValue(), P->getSize(), P->getAAInfo()),
MemoryLocation(Entry.getValue(), Size, AAInfo));
- if (Result != AliasAnalysis::MustAlias)
+ if (Result != MustAlias)
Alias = SetMayAlias;
else // First entry of must alias must have maximum size!
P->updateSizeAndAAInfo(Size, AAInfo);
- assert(Result != AliasAnalysis::NoAlias && "Cannot be part of must set!");
+ assert(Result != NoAlias && "Cannot be part of must set!");
}
Entry.setAliasSet(this);
/// \brief Provide ad-hoc rules to disambiguate accesses through two GEP
/// operators, both having the exact same pointer operand.
-static AliasAnalysis::AliasResult
-aliasSameBasePointerGEPs(const GEPOperator *GEP1, uint64_t V1Size,
- const GEPOperator *GEP2, uint64_t V2Size,
- const DataLayout &DL) {
+static AliasResult aliasSameBasePointerGEPs(const GEPOperator *GEP1,
+ uint64_t V1Size,
+ const GEPOperator *GEP2,
+ uint64_t V2Size,
+ const DataLayout &DL) {
assert(GEP1->getPointerOperand() == GEP2->getPointerOperand() &&
"Expected GEPs with the same pointer operand");
// We also need at least two indices (the pointer, and the struct field).
if (GEP1->getNumIndices() != GEP2->getNumIndices() ||
GEP1->getNumIndices() < 2)
- return AliasAnalysis::MayAlias;
+ return MayAlias;
// If we don't know the size of the accesses through both GEPs, we can't
// determine whether the struct fields accessed can't alias.
if (V1Size == MemoryLocation::UnknownSize ||
V2Size == MemoryLocation::UnknownSize)
- return AliasAnalysis::MayAlias;
+ return MayAlias;
ConstantInt *C1 =
dyn_cast<ConstantInt>(GEP1->getOperand(GEP1->getNumOperands() - 1));
// If they're identical, the other indices might be also be dynamically
// equal, so the GEPs can alias.
if (!C1 || !C2 || C1 == C2)
- return AliasAnalysis::MayAlias;
+ return MayAlias;
// Find the last-indexed type of the GEP, i.e., the type you'd get if
// you stripped the last index.
for (unsigned i = 1, e = GEP1->getNumIndices() - 1; i != e; ++i) {
if (!isa<ArrayType>(GetElementPtrInst::getIndexedType(
GEP1->getSourceElementType(), IntermediateIndices)))
- return AliasAnalysis::MayAlias;
+ return MayAlias;
IntermediateIndices.push_back(GEP1->getOperand(i + 1));
}
GEP1->getSourceElementType(), IntermediateIndices));
if (!LastIndexedStruct)
- return AliasAnalysis::MayAlias;
+ return MayAlias;
// We know that:
// - both GEPs begin indexing from the exact same pointer;
if (EltsDontOverlap(V1Off, V1Size, V2Off, V2Size) ||
EltsDontOverlap(V2Off, V2Size, V1Off, V1Size))
- return AliasAnalysis::NoAlias;
+ return NoAlias;
- return AliasAnalysis::MayAlias;
+ return MayAlias;
}
/// aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP instruction
/// anything about V2. UnderlyingV1 is GetUnderlyingObject(GEP1, DL),
/// UnderlyingV2 is the same for V2.
///
-AliasAnalysis::AliasResult
-BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
- const AAMDNodes &V1AAInfo,
- const Value *V2, uint64_t V2Size,
- const AAMDNodes &V2AAInfo,
- const Value *UnderlyingV1,
- const Value *UnderlyingV2) {
+AliasResult BasicAliasAnalysis::aliasGEP(
+ const GEPOperator *GEP1, uint64_t V1Size, const AAMDNodes &V1AAInfo,
+ const Value *V2, uint64_t V2Size, const AAMDNodes &V2AAInfo,
+ const Value *UnderlyingV1, const Value *UnderlyingV2) {
int64_t GEP1BaseOffset;
bool GEP1MaxLookupReached;
SmallVector<VariableGEPIndex, 4> GEP1VariableIndices;
return PartialAlias;
}
-static AliasAnalysis::AliasResult
-MergeAliasResults(AliasAnalysis::AliasResult A, AliasAnalysis::AliasResult B) {
+static AliasResult MergeAliasResults(AliasResult A, AliasResult B) {
// If the results agree, take it.
if (A == B)
return A;
// A mix of PartialAlias and MustAlias is PartialAlias.
- if ((A == AliasAnalysis::PartialAlias && B == AliasAnalysis::MustAlias) ||
- (B == AliasAnalysis::PartialAlias && A == AliasAnalysis::MustAlias))
- return AliasAnalysis::PartialAlias;
+ if ((A == PartialAlias && B == MustAlias) ||
+ (B == PartialAlias && A == MustAlias))
+ return PartialAlias;
// Otherwise, we don't know anything.
- return AliasAnalysis::MayAlias;
+ return MayAlias;
}
/// aliasSelect - Provide a bunch of ad-hoc rules to disambiguate a Select
/// instruction against another.
-AliasAnalysis::AliasResult
-BasicAliasAnalysis::aliasSelect(const SelectInst *SI, uint64_t SISize,
- const AAMDNodes &SIAAInfo,
- const Value *V2, uint64_t V2Size,
- const AAMDNodes &V2AAInfo) {
+AliasResult BasicAliasAnalysis::aliasSelect(const SelectInst *SI,
+ uint64_t SISize,
+ const AAMDNodes &SIAAInfo,
+ const Value *V2, uint64_t V2Size,
+ const AAMDNodes &V2AAInfo) {
// If the values are Selects with the same condition, we can do a more precise
// check: just check for aliases between the values on corresponding arms.
if (const SelectInst *SI2 = dyn_cast<SelectInst>(V2))
// aliasPHI - Provide a bunch of ad-hoc rules to disambiguate a PHI instruction
// against another.
-AliasAnalysis::AliasResult
-BasicAliasAnalysis::aliasPHI(const PHINode *PN, uint64_t PNSize,
- const AAMDNodes &PNAAInfo,
- const Value *V2, uint64_t V2Size,
- const AAMDNodes &V2AAInfo) {
+AliasResult BasicAliasAnalysis::aliasPHI(const PHINode *PN, uint64_t PNSize,
+ const AAMDNodes &PNAAInfo,
+ const Value *V2, uint64_t V2Size,
+ const AAMDNodes &V2AAInfo) {
// Track phi nodes we have visited. We use this information when we determine
// value equivalence.
VisitedPhiBBs.insert(PN->getParent());
// aliasCheck - Provide a bunch of ad-hoc rules to disambiguate in common cases,
// such as array references.
//
-AliasAnalysis::AliasResult
-BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size,
- AAMDNodes V1AAInfo,
- const Value *V2, uint64_t V2Size,
- AAMDNodes V2AAInfo) {
+AliasResult BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size,
+ AAMDNodes V1AAInfo, const Value *V2,
+ uint64_t V2Size,
+ AAMDNodes V2AAInfo) {
// If either of the memory references is empty, it doesn't matter what the
// pointer values are.
if (V1Size == 0 || V2Size == 0)
Handles.push_front(FunctionHandle(Fn, this));
}
-AliasAnalysis::AliasResult CFLAliasAnalysis::query(const MemoryLocation &LocA,
- const MemoryLocation &LocB) {
+AliasResult CFLAliasAnalysis::query(const MemoryLocation &LocA,
+ const MemoryLocation &LocB) {
auto *ValA = const_cast<Value *>(LocA.Ptr);
auto *ValB = const_cast<Value *>(LocB.Ptr);
// The only times this is known to happen are when globals + InlineAsm
// are involved
DEBUG(dbgs() << "CFLAA: could not extract parent function information.\n");
- return AliasAnalysis::MayAlias;
+ return MayAlias;
}
if (MaybeFnA.hasValue()) {
auto &Sets = MaybeInfo->Sets;
auto MaybeA = Sets.find(ValA);
if (!MaybeA.hasValue())
- return AliasAnalysis::MayAlias;
+ return MayAlias;
auto MaybeB = Sets.find(ValB);
if (!MaybeB.hasValue())
- return AliasAnalysis::MayAlias;
+ return MayAlias;
auto SetA = *MaybeA;
auto SetB = *MaybeB;
// the sets has no values that could legally be altered by changing the value
// of an argument or global, then we don't have to be as conservative.
if (AttrsA.any() && AttrsB.any())
- return AliasAnalysis::MayAlias;
+ return MayAlias;
// We currently unify things even if the accesses to them may not be in
// bounds, so we can't return partial alias here because we don't
// differentiate
if (SetA.Index == SetB.Index)
- return AliasAnalysis::MayAlias;
+ return MayAlias;
- return AliasAnalysis::NoAlias;
+ return NoAlias;
}
bool CFLAliasAnalysis::doInitialization(Module &M) {
OS << "!\n";
}
-static AliasAnalysis::AliasResult underlyingObjectsAlias(AliasAnalysis *AA,
- const DataLayout &DL,
- const Value *A,
- const Value *B) {
+static AliasResult underlyingObjectsAlias(AliasAnalysis *AA,
+ const DataLayout &DL, const Value *A,
+ const Value *B) {
const Value *AObj = GetUnderlyingObject(A, DL);
const Value *BObj = GetUnderlyingObject(B, DL);
return AA->alias(AObj, AA->getTypeStoreSize(AObj->getType()),
switch (underlyingObjectsAlias(AA, F->getParent()->getDataLayout(), DstPtr,
SrcPtr)) {
- case AliasAnalysis::MayAlias:
- case AliasAnalysis::PartialAlias:
+ case MayAlias:
+ case PartialAlias:
// cannot analyse objects if we don't understand their aliasing.
DEBUG(dbgs() << "can't analyze may or partial alias\n");
return make_unique<Dependence>(Src, Dst);
- case AliasAnalysis::NoAlias:
+ case NoAlias:
// If the objects noalias, they are distinct, accesses are independent.
DEBUG(dbgs() << "no alias\n");
return nullptr;
- case AliasAnalysis::MustAlias:
+ case MustAlias:
break; // The underlying objects alias; test accesses for dependence.
}
Value *SrcPtr = getPointerOperand(Src);
Value *DstPtr = getPointerOperand(Dst);
assert(underlyingObjectsAlias(AA, F->getParent()->getDataLayout(), DstPtr,
- SrcPtr) == AliasAnalysis::MustAlias);
+ SrcPtr) == MustAlias);
// establish loop nesting levels
establishNestingLevels(Src, Dst);
/// alias - If one of the pointers is to a global that we are tracking, and the
/// other is some random pointer, we know there cannot be an alias, because the
/// address of the global isn't taken.
-AliasAnalysis::AliasResult GlobalsModRef::alias(const MemoryLocation &LocA,
- const MemoryLocation &LocB) {
+AliasResult GlobalsModRef::alias(const MemoryLocation &LocA,
+ const MemoryLocation &LocB) {
// Get the base object these pointers point to.
const Value *UV1 = GetUnderlyingObject(LocA.Ptr, *DL);
const Value *UV2 = GetUnderlyingObject(LocB.Ptr, *DL);
if (Formal->hasNoAliasAttr() && Actual->getType()->isPointerTy())
for (CallSite::arg_iterator BI = CS.arg_begin(); BI != AE; ++BI)
if (AI != BI && (*BI)->getType()->isPointerTy()) {
- AliasAnalysis::AliasResult Result = AA->alias(*AI, *BI);
- Assert(Result != AliasAnalysis::MustAlias &&
- Result != AliasAnalysis::PartialAlias,
+ AliasResult Result = AA->alias(*AI, *BI);
+ Assert(Result != MustAlias && Result != PartialAlias,
"Unusual: noalias argument aliases another argument", &I);
}
if (Len->getValue().isIntN(32))
Size = Len->getValue().getZExtValue();
Assert(AA->alias(MCI->getSource(), Size, MCI->getDest(), Size) !=
- AliasAnalysis::MustAlias,
+ MustAlias,
"Undefined behavior: memcpy source and destination overlap", &I);
break;
}
MemoryLocation LoadLoc = MemoryLocation::get(LI);
// If we found a pointer, check if it could be the same as our pointer.
- AliasAnalysis::AliasResult R = AA->alias(LoadLoc, MemLoc);
+ AliasResult R = AA->alias(LoadLoc, MemLoc);
if (isLoad) {
- if (R == AliasAnalysis::NoAlias) {
+ if (R == NoAlias) {
// If this is an over-aligned integer load (for example,
// "load i8* %P, align 4") see if it would obviously overlap with the
// queried location if widened to a larger load (e.g. if the queried
}
// Must aliased loads are defs of each other.
- if (R == AliasAnalysis::MustAlias)
+ if (R == MustAlias)
return MemDepResult::getDef(Inst);
#if 0 // FIXME: Temporarily disabled. GVN is cleverly rewriting loads
// If we have a partial alias, then return this as a clobber for the
// client to handle.
- if (R == AliasAnalysis::PartialAlias)
+ if (R == PartialAlias)
return MemDepResult::getClobber(Inst);
#endif
}
// Stores don't depend on other no-aliased accesses.
- if (R == AliasAnalysis::NoAlias)
+ if (R == NoAlias)
continue;
// Stores don't alias loads from read-only memory.
MemoryLocation StoreLoc = MemoryLocation::get(SI);
// If we found a pointer, check if it could be the same as our pointer.
- AliasAnalysis::AliasResult R = AA->alias(StoreLoc, MemLoc);
+ AliasResult R = AA->alias(StoreLoc, MemLoc);
- if (R == AliasAnalysis::NoAlias)
+ if (R == NoAlias)
continue;
- if (R == AliasAnalysis::MustAlias)
+ if (R == MustAlias)
return MemDepResult::getDef(Inst);
if (isInvariantLoad)
continue;
if (isInvariantLoad)
continue;
// Be conservative if the accessed pointer may alias the allocation.
- if (AA->alias(Inst, AccessPtr) != AliasAnalysis::NoAlias)
+ if (AA->alias(Inst, AccessPtr) != NoAlias)
return MemDepResult::getClobber(Inst);
// If the allocation is not aliased and does not read memory (like
// strdup), it is safe to ignore.
return nullptr;
}
-AliasAnalysis::AliasResult
-ScalarEvolutionAliasAnalysis::alias(const MemoryLocation &LocA,
- const MemoryLocation &LocB) {
+AliasResult ScalarEvolutionAliasAnalysis::alias(const MemoryLocation &LocA,
+ const MemoryLocation &LocB) {
// If either of the memory references is empty, it doesn't matter what the
// pointer values are. This allows the code below to ignore this special
// case.
return true;
}
-AliasAnalysis::AliasResult ScopedNoAliasAA::alias(const MemoryLocation &LocA,
- const MemoryLocation &LocB) {
+AliasResult ScopedNoAliasAA::alias(const MemoryLocation &LocA,
+ const MemoryLocation &LocB) {
if (!EnableScopedNoAlias)
return AliasAnalysis::alias(LocA, LocB);
return false;
}
-AliasAnalysis::AliasResult
-TypeBasedAliasAnalysis::alias(const MemoryLocation &LocA,
- const MemoryLocation &LocB) {
+AliasResult TypeBasedAliasAnalysis::alias(const MemoryLocation &LocA,
+ const MemoryLocation &LocB) {
if (!EnableTBAA)
return AliasAnalysis::alias(LocA, LocB);
int64_t Overlapa = MMOa->getSize() + MMOa->getOffset() - MinOffset;
int64_t Overlapb = MMOb->getSize() + MMOb->getOffset() - MinOffset;
- AliasAnalysis::AliasResult AAResult =
+ AliasResult AAResult =
AA->alias(MemoryLocation(MMOa->getValue(), Overlapa,
UseTBAA ? MMOa->getAAInfo() : AAMDNodes()),
MemoryLocation(MMOb->getValue(), Overlapb,
UseTBAA ? MMOb->getAAInfo() : AAMDNodes()));
- return (AAResult != AliasAnalysis::NoAlias);
+ return (AAResult != NoAlias);
}
/// This recursive function iterates over chain deps of SUb looking for
Op0->getSrcValueOffset() - MinOffset;
int64_t Overlap2 = (Op1->getMemoryVT().getSizeInBits() >> 3) +
Op1->getSrcValueOffset() - MinOffset;
- AliasAnalysis::AliasResult AAResult =
+ AliasResult AAResult =
AA.alias(MemoryLocation(Op0->getMemOperand()->getValue(), Overlap1,
UseTBAA ? Op0->getAAInfo() : AAMDNodes()),
MemoryLocation(Op1->getMemOperand()->getValue(), Overlap2,
UseTBAA ? Op1->getAAInfo() : AAMDNodes()));
- if (AAResult == AliasAnalysis::NoAlias)
+ if (AAResult == NoAlias)
return false;
}
AliasAnalysis::getAnalysisUsage(AU);
}
-AliasAnalysis::AliasResult
-ObjCARCAliasAnalysis::alias(const MemoryLocation &LocA,
- const MemoryLocation &LocB) {
+AliasResult ObjCARCAliasAnalysis::alias(const MemoryLocation &LocA,
+ const MemoryLocation &LocB) {
if (!EnableARCOpts)
return AliasAnalysis::alias(LocA, LocB);
Value *Arg = Call->getArgOperand(0);
Value *EarlierArg = EarlierCall->getArgOperand(0);
switch (PA.getAA()->alias(Arg, EarlierArg)) {
- case AliasAnalysis::MustAlias:
+ case MustAlias:
Changed = true;
// If the load has a builtin retain, insert a plain retain for it.
if (Class == ARCInstKind::LoadWeakRetained) {
Call->replaceAllUsesWith(EarlierCall);
Call->eraseFromParent();
goto clobbered;
- case AliasAnalysis::MayAlias:
- case AliasAnalysis::PartialAlias:
+ case MayAlias:
+ case PartialAlias:
goto clobbered;
- case AliasAnalysis::NoAlias:
+ case NoAlias:
break;
}
break;
Value *Arg = Call->getArgOperand(0);
Value *EarlierArg = EarlierCall->getArgOperand(0);
switch (PA.getAA()->alias(Arg, EarlierArg)) {
- case AliasAnalysis::MustAlias:
+ case MustAlias:
Changed = true;
// If the load has a builtin retain, insert a plain retain for it.
if (Class == ARCInstKind::LoadWeakRetained) {
Call->replaceAllUsesWith(EarlierCall->getArgOperand(1));
Call->eraseFromParent();
goto clobbered;
- case AliasAnalysis::MayAlias:
- case AliasAnalysis::PartialAlias:
+ case MayAlias:
+ case PartialAlias:
goto clobbered;
- case AliasAnalysis::NoAlias:
+ case NoAlias:
break;
}
break;
// Ask regular AliasAnalysis, for a first approximation.
switch (AA->alias(A, B)) {
- case AliasAnalysis::NoAlias:
+ case NoAlias:
return false;
- case AliasAnalysis::MustAlias:
- case AliasAnalysis::PartialAlias:
+ case MustAlias:
+ case PartialAlias:
return true;
- case AliasAnalysis::MayAlias:
+ case MayAlias:
break;
}