X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FAnalysis%2FGlobalsModRef.h;h=bcd102e7ded2ad7b7b7e251a551b5fd2a0c9fff0;hb=7f410b17a792c624d2b939fa56285f8eb8cba184;hp=c142ec22f126afbb9e3592a51b42b284ac54cd44;hpb=9146833fa313fb0339355f9ca8b63122dd73ba88;p=oota-llvm.git diff --git a/include/llvm/Analysis/GlobalsModRef.h b/include/llvm/Analysis/GlobalsModRef.h index c142ec22f12..bcd102e7ded 100644 --- a/include/llvm/Analysis/GlobalsModRef.h +++ b/include/llvm/Analysis/GlobalsModRef.h @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// /// \file -/// This is the interface for a simple mod/ref and alias analysis over globlas. +/// This is the interface for a simple mod/ref and alias analysis over globals. /// //===----------------------------------------------------------------------===// @@ -50,13 +50,18 @@ class GlobalsAAResult : public AAResultBase { /// For each function, keep track of what globals are modified or read. DenseMap FunctionInfos; + /// A map of functions to SCC. The SCCs are described by a simple integer + /// ID that is only useful for comparing for equality (are two functions + /// in the same SCC or not?) + DenseMap FunctionToSCCMap; + /// Handle to clear this analysis on deletion of values. struct DeletionCallbackHandle final : CallbackVH { - GlobalsAAResult &GAR; + GlobalsAAResult *GAR; std::list::iterator I; DeletionCallbackHandle(GlobalsAAResult &GAR, Value *V) - : CallbackVH(V), GAR(GAR) {} + : CallbackVH(V), GAR(&GAR) {} void deleted() override; }; @@ -102,9 +107,12 @@ private: SmallPtrSetImpl *Readers = nullptr, SmallPtrSetImpl *Writers = nullptr, GlobalValue *OkayStoreDest = nullptr); - bool AnalyzeIndirectGlobalMemory(GlobalValue *GV); + bool AnalyzeIndirectGlobalMemory(GlobalVariable *GV); + void CollectSCCMembership(CallGraph &CG); bool isNonEscapingGlobalNoAlias(const GlobalValue *GV, const Value *V); + ModRefInfo getModRefInfoForArgument(ImmutableCallSite CS, + const GlobalValue *GV); }; /// Analysis pass providing a never-invalidated alias analysis result.