diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:03:47 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:04:23 +0000 |
commit | 7fa27ce4a07f19b07799a767fc29416f3b625afb (patch) | |
tree | 27825c83636c4de341eb09a74f49f5d38a15d165 /llvm/lib/Analysis/AliasAnalysis.cpp | |
parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) | |
download | src-7fa27ce4a07f19b07799a767fc29416f3b625afb.tar.gz src-7fa27ce4a07f19b07799a767fc29416f3b625afb.zip |
Vendor import of llvm-project main llvmorg-17-init-19304-gd0b54bb50e51,vendor/llvm-project/llvmorg-17-init-19304-gd0b54bb50e51
the last commit before the upstream release/17.x branch was created.
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/AliasAnalysis.cpp | 52 |
1 files changed, 7 insertions, 45 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp index 9e24f6b87bdb..7b2f91f5392a 100644 --- a/llvm/lib/Analysis/AliasAnalysis.cpp +++ b/llvm/lib/Analysis/AliasAnalysis.cpp @@ -227,12 +227,12 @@ ModRefInfo AAResults::getModRefInfo(const CallBase *Call, // We can completely ignore inaccessible memory here, because MemoryLocations // can only reference accessible memory. auto ME = getMemoryEffects(Call, AAQI) - .getWithoutLoc(MemoryEffects::InaccessibleMem); + .getWithoutLoc(IRMemLocation::InaccessibleMem); if (ME.doesNotAccessMemory()) return ModRefInfo::NoModRef; - ModRefInfo ArgMR = ME.getModRef(MemoryEffects::ArgMem); - ModRefInfo OtherMR = ME.getWithoutLoc(MemoryEffects::ArgMem).getModRef(); + ModRefInfo ArgMR = ME.getModRef(IRMemLocation::ArgMem); + ModRefInfo OtherMR = ME.getWithoutLoc(IRMemLocation::ArgMem).getModRef(); if ((ArgMR | OtherMR) != OtherMR) { // Refine the modref info for argument memory. We only bother to do this // if ArgMR is not a subset of OtherMR, otherwise this won't have an impact @@ -442,15 +442,15 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, ModRefInfo MR) { } raw_ostream &llvm::operator<<(raw_ostream &OS, MemoryEffects ME) { - for (MemoryEffects::Location Loc : MemoryEffects::locations()) { + for (IRMemLocation Loc : MemoryEffects::locations()) { switch (Loc) { - case MemoryEffects::ArgMem: + case IRMemLocation::ArgMem: OS << "ArgMem: "; break; - case MemoryEffects::InaccessibleMem: + case IRMemLocation::InaccessibleMem: OS << "InaccessibleMem: "; break; - case MemoryEffects::Other: + case IRMemLocation::Other: OS << "Other: "; break; } @@ -768,10 +768,6 @@ INITIALIZE_PASS_DEPENDENCY(TypeBasedAAWrapperPass) INITIALIZE_PASS_END(AAResultsWrapperPass, "aa", "Function Alias Analysis Results", false, true) -FunctionPass *llvm::createAAResultsWrapperPass() { - return new AAResultsWrapperPass(); -} - /// Run the wrapper pass to rebuild an aggregation over known AA passes. /// /// This is the legacy pass manager's interface to the new-style AA results @@ -840,29 +836,6 @@ AAManager::Result AAManager::run(Function &F, FunctionAnalysisManager &AM) { return R; } -AAResults llvm::createLegacyPMAAResults(Pass &P, Function &F, - BasicAAResult &BAR) { - AAResults AAR(P.getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F)); - - // Add in our explicitly constructed BasicAA results. - if (!DisableBasicAA) - AAR.addAAResult(BAR); - - // Populate the results with the other currently available AAs. - if (auto *WrapperPass = - P.getAnalysisIfAvailable<ScopedNoAliasAAWrapperPass>()) - AAR.addAAResult(WrapperPass->getResult()); - if (auto *WrapperPass = P.getAnalysisIfAvailable<TypeBasedAAWrapperPass>()) - AAR.addAAResult(WrapperPass->getResult()); - if (auto *WrapperPass = P.getAnalysisIfAvailable<GlobalsAAWrapperPass>()) - AAR.addAAResult(WrapperPass->getResult()); - if (auto *WrapperPass = P.getAnalysisIfAvailable<ExternalAAWrapperPass>()) - if (WrapperPass->CB) - WrapperPass->CB(P, F, AAR); - - return AAR; -} - bool llvm::isNoAliasCall(const Value *V) { if (const auto *Call = dyn_cast<CallBase>(V)) return Call->hasRetAttr(Attribute::NoAlias); @@ -935,14 +908,3 @@ bool llvm::isNotVisibleOnUnwind(const Value *Object, return false; } - -void llvm::getAAResultsAnalysisUsage(AnalysisUsage &AU) { - // This function needs to be in sync with llvm::createLegacyPMAAResults -- if - // more alias analyses are added to llvm::createLegacyPMAAResults, they need - // to be added here also. - AU.addRequired<TargetLibraryInfoWrapperPass>(); - AU.addUsedIfAvailable<ScopedNoAliasAAWrapperPass>(); - AU.addUsedIfAvailable<TypeBasedAAWrapperPass>(); - AU.addUsedIfAvailable<GlobalsAAWrapperPass>(); - AU.addUsedIfAvailable<ExternalAAWrapperPass>(); -} |