1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

Revert "Move ModuleSummaryAnalysis from libAnalysis to libObject to break the dependency from Analysis to Object"

This reverts commit 10df1563d608323a3144afc5f6038ecb81869b92.

Some buildbots are broken.
This commit is contained in:
Mehdi Amini 2020-04-14 00:27:08 +00:00
parent 9aac046d54
commit e27edda00f
9 changed files with 19 additions and 24 deletions

View File

@ -67,6 +67,7 @@ add_llvm_component_library(LLVMAnalysis
MemorySSA.cpp MemorySSA.cpp
MemorySSAUpdater.cpp MemorySSAUpdater.cpp
ModuleDebugInfoPrinter.cpp ModuleDebugInfoPrinter.cpp
ModuleSummaryAnalysis.cpp
MustExecute.cpp MustExecute.cpp
ObjCARCAliasAnalysis.cpp ObjCARCAliasAnalysis.cpp
ObjCARCAnalysisUtils.cpp ObjCARCAnalysisUtils.cpp

View File

@ -18,4 +18,4 @@
type = Library type = Library
name = Analysis name = Analysis
parent = Libraries parent = Libraries
required_libraries = BinaryFormat Core ProfileData Support required_libraries = BinaryFormat Core Object ProfileData Support

View File

@ -11,7 +11,7 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/Object/ModuleSummaryAnalysis.h" #include "llvm/Analysis/ModuleSummaryAnalysis.h"
#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h" #include "llvm/ADT/MapVector.h"
@ -327,8 +327,7 @@ static void computeFunctionSummary(ModuleSummaryIndex &Index, const Module &M,
// Check if this is an alias to a function. If so, get the // Check if this is an alias to a function. If so, get the
// called aliasee for the checks below. // called aliasee for the checks below.
if (auto *GA = dyn_cast<GlobalAlias>(CalledValue)) { if (auto *GA = dyn_cast<GlobalAlias>(CalledValue)) {
assert(!CalledFunction && assert(!CalledFunction && "Expected null called function in callsite for alias");
"Expected null called function in callsite for alias");
CalledFunction = dyn_cast<Function>(GA->getBaseObject()); CalledFunction = dyn_cast<Function>(GA->getBaseObject());
} }
// Check if this is a direct call to a known function or a known // Check if this is a direct call to a known function or a known
@ -461,8 +460,7 @@ static void computeFunctionSummary(ModuleSummaryIndex &Index, const Module &M,
NonRenamableLocal || HasInlineAsmMaybeReferencingInternal; NonRenamableLocal || HasInlineAsmMaybeReferencingInternal;
GlobalValueSummary::GVFlags Flags(F.getLinkage(), NotEligibleForImport, GlobalValueSummary::GVFlags Flags(F.getLinkage(), NotEligibleForImport,
/* Live = */ false, F.isDSOLocal(), /* Live = */ false, F.isDSOLocal(),
F.hasLinkOnceODRLinkage() && F.hasLinkOnceODRLinkage() && F.hasGlobalUnnamedAddr());
F.hasGlobalUnnamedAddr());
FunctionSummary::FFlags FunFlags{ FunctionSummary::FFlags FunFlags{
F.hasFnAttribute(Attribute::ReadNone), F.hasFnAttribute(Attribute::ReadNone),
F.hasFnAttribute(Attribute::ReadOnly), F.hasFnAttribute(Attribute::ReadOnly),
@ -580,8 +578,7 @@ static void computeVariableSummary(ModuleSummaryIndex &Index,
bool NonRenamableLocal = isNonRenamableLocal(V); bool NonRenamableLocal = isNonRenamableLocal(V);
GlobalValueSummary::GVFlags Flags(V.getLinkage(), NonRenamableLocal, GlobalValueSummary::GVFlags Flags(V.getLinkage(), NonRenamableLocal,
/* Live = */ false, V.isDSOLocal(), /* Live = */ false, V.isDSOLocal(),
V.hasLinkOnceODRLinkage() && V.hasLinkOnceODRLinkage() && V.hasGlobalUnnamedAddr());
V.hasGlobalUnnamedAddr());
VTableFuncList VTableFuncs; VTableFuncList VTableFuncs;
// If splitting is not enabled, then we compute the summary information // If splitting is not enabled, then we compute the summary information
@ -617,13 +614,13 @@ static void computeVariableSummary(ModuleSummaryIndex &Index,
Index.addGlobalValueSummary(V, std::move(GVarSummary)); Index.addGlobalValueSummary(V, std::move(GVarSummary));
} }
static void computeAliasSummary(ModuleSummaryIndex &Index, const GlobalAlias &A, static void
computeAliasSummary(ModuleSummaryIndex &Index, const GlobalAlias &A,
DenseSet<GlobalValue::GUID> &CantBePromoted) { DenseSet<GlobalValue::GUID> &CantBePromoted) {
bool NonRenamableLocal = isNonRenamableLocal(A); bool NonRenamableLocal = isNonRenamableLocal(A);
GlobalValueSummary::GVFlags Flags(A.getLinkage(), NonRenamableLocal, GlobalValueSummary::GVFlags Flags(A.getLinkage(), NonRenamableLocal,
/* Live = */ false, A.isDSOLocal(), /* Live = */ false, A.isDSOLocal(),
A.hasLinkOnceODRLinkage() && A.hasLinkOnceODRLinkage() && A.hasGlobalUnnamedAddr());
A.hasGlobalUnnamedAddr());
auto AS = std::make_unique<AliasSummary>(Flags); auto AS = std::make_unique<AliasSummary>(Flags);
auto *Aliasee = A.getBaseObject(); auto *Aliasee = A.getBaseObject();
auto AliaseeVI = Index.getValueInfo(Aliasee->getGUID()); auto AliaseeVI = Index.getValueInfo(Aliasee->getGUID());
@ -694,14 +691,12 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex(
GlobalValue *GV = M.getNamedValue(Name); GlobalValue *GV = M.getNamedValue(Name);
if (!GV) if (!GV)
return; return;
assert(GV->isDeclaration() && assert(GV->isDeclaration() && "Def in module asm already has definition");
"Def in module asm already has definition");
GlobalValueSummary::GVFlags GVFlags(GlobalValue::InternalLinkage, GlobalValueSummary::GVFlags GVFlags(GlobalValue::InternalLinkage,
/* NotEligibleToImport = */ true, /* NotEligibleToImport = */ true,
/* Live = */ true, /* Live = */ true,
/* Local */ GV->isDSOLocal(), /* Local */ GV->isDSOLocal(),
GV->hasLinkOnceODRLinkage() && GV->hasLinkOnceODRLinkage() && GV->hasGlobalUnnamedAddr());
GV->hasGlobalUnnamedAddr());
CantBePromoted.insert(GV->getGUID()); CantBePromoted.insert(GV->getGUID());
// Create the appropriate summary type. // Create the appropriate summary type.
if (Function *F = dyn_cast<Function>(GV)) { if (Function *F = dyn_cast<Function>(GV)) {
@ -839,8 +834,8 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex(
AnalysisKey ModuleSummaryIndexAnalysis::Key; AnalysisKey ModuleSummaryIndexAnalysis::Key;
ModuleSummaryIndex ModuleSummaryIndexAnalysis::run(Module &M, ModuleSummaryIndex
ModuleAnalysisManager &AM) { ModuleSummaryIndexAnalysis::run(Module &M, ModuleAnalysisManager &AM) {
ProfileSummaryInfo &PSI = AM.getResult<ProfileSummaryAnalysis>(M); ProfileSummaryInfo &PSI = AM.getResult<ProfileSummaryAnalysis>(M);
auto &FAM = AM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager(); auto &FAM = AM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
return buildModuleSummaryIndex( return buildModuleSummaryIndex(

View File

@ -11,11 +11,11 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/Bitcode/BitcodeWriterPass.h" #include "llvm/Bitcode/BitcodeWriterPass.h"
#include "llvm/Analysis/ModuleSummaryAnalysis.h"
#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/Bitcode/BitcodeWriter.h"
#include "llvm/IR/Module.h" #include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h" #include "llvm/IR/PassManager.h"
#include "llvm/InitializePasses.h" #include "llvm/InitializePasses.h"
#include "llvm/Object/ModuleSummaryAnalysis.h"
#include "llvm/Pass.h" #include "llvm/Pass.h"
using namespace llvm; using namespace llvm;

View File

@ -16,6 +16,7 @@
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringExtras.h"
#include "llvm/Analysis/ModuleSummaryAnalysis.h"
#include "llvm/Analysis/ProfileSummaryInfo.h" #include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/Analysis/TargetTransformInfo.h"
@ -36,7 +37,6 @@
#include "llvm/LTO/SummaryBasedOptimizations.h" #include "llvm/LTO/SummaryBasedOptimizations.h"
#include "llvm/MC/SubtargetFeature.h" #include "llvm/MC/SubtargetFeature.h"
#include "llvm/Object/IRObjectFile.h" #include "llvm/Object/IRObjectFile.h"
#include "llvm/Object/ModuleSummaryAnalysis.h"
#include "llvm/Support/CachePruning.h" #include "llvm/Support/CachePruning.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
#include "llvm/Support/Error.h" #include "llvm/Support/Error.h"

View File

@ -14,7 +14,6 @@ add_llvm_component_library(LLVMObject
MachOObjectFile.cpp MachOObjectFile.cpp
MachOUniversal.cpp MachOUniversal.cpp
Minidump.cpp Minidump.cpp
ModuleSummaryAnalysis.cpp
ModuleSymbolTable.cpp ModuleSymbolTable.cpp
Object.cpp Object.cpp
ObjectFile.cpp ObjectFile.cpp

View File

@ -41,6 +41,7 @@
#include "llvm/Analysis/LoopNestAnalysis.h" #include "llvm/Analysis/LoopNestAnalysis.h"
#include "llvm/Analysis/MemoryDependenceAnalysis.h" #include "llvm/Analysis/MemoryDependenceAnalysis.h"
#include "llvm/Analysis/MemorySSA.h" #include "llvm/Analysis/MemorySSA.h"
#include "llvm/Analysis/ModuleSummaryAnalysis.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h" #include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/Analysis/PhiValues.h" #include "llvm/Analysis/PhiValues.h"
#include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/PostDominators.h"
@ -61,7 +62,6 @@
#include "llvm/IR/PassManager.h" #include "llvm/IR/PassManager.h"
#include "llvm/IR/SafepointIRVerifier.h" #include "llvm/IR/SafepointIRVerifier.h"
#include "llvm/IR/Verifier.h" #include "llvm/IR/Verifier.h"
#include "llvm/Object/ModuleSummaryAnalysis.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
#include "llvm/Support/FormatVariadic.h" #include "llvm/Support/FormatVariadic.h"

View File

@ -8,6 +8,7 @@
#include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h" #include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"
#include "llvm/Analysis/BasicAliasAnalysis.h" #include "llvm/Analysis/BasicAliasAnalysis.h"
#include "llvm/Analysis/ModuleSummaryAnalysis.h"
#include "llvm/Analysis/ProfileSummaryInfo.h" #include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/Analysis/TypeMetadataUtils.h" #include "llvm/Analysis/TypeMetadataUtils.h"
#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/Bitcode/BitcodeWriter.h"
@ -17,7 +18,6 @@
#include "llvm/IR/Module.h" #include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h" #include "llvm/IR/PassManager.h"
#include "llvm/InitializePasses.h" #include "llvm/InitializePasses.h"
#include "llvm/Object/ModuleSummaryAnalysis.h"
#include "llvm/Object/ModuleSymbolTable.h" #include "llvm/Object/ModuleSymbolTable.h"
#include "llvm/Pass.h" #include "llvm/Pass.h"
#include "llvm/Support/ScopedPrinter.h" #include "llvm/Support/ScopedPrinter.h"