[llvm] [clang] Support VFE in thinLTO (PR #69735)

2023-11-06 Thread Teresa Johnson via cfe-commits
@@ -338,12 +574,33 @@ PreservedAnalyses GlobalDCEPass::run(Module &M, ModuleAnalysisManager &MAM) { // The second pass drops the bodies of functions which are dead... std::vector DeadFunctions; - for (Function &F : M) + std::set DeadFunctionsSet; + auto funcRemovedInIn

[llvm] [clang] Support VFE in thinLTO (PR #69735)

2023-11-06 Thread Teresa Johnson via cfe-commits
@@ -34,12 +40,223 @@ static cl::opt ClEnableVFE("enable-vfe", cl::Hidden, cl::init(true), cl::desc("Enable virtual function elimination")); +static cl::opt ClReadSummary( +"globaldce-read-summary", +cl::desc("Read summary from given bitcode before r

[llvm] [clang] Support VFE in thinLTO (PR #69735)

2023-11-06 Thread Teresa Johnson via cfe-commits
@@ -34,12 +40,223 @@ static cl::opt ClEnableVFE("enable-vfe", cl::Hidden, cl::init(true), cl::desc("Enable virtual function elimination")); +static cl::opt ClReadSummary( +"globaldce-read-summary", +cl::desc("Read summary from given bitcode before r

[llvm] [clang] Support VFE in thinLTO (PR #69735)

2023-11-06 Thread Teresa Johnson via cfe-commits
@@ -775,6 +783,58 @@ static void computeVariableSummary(ModuleSummaryIndex &Index, Index.addGlobalValueSummary(V, std::move(GVarSummary)); } +static void ComputeDependencies( teresajohnson wrote: nit: function should be lowerCamelCase https://github.com/l

[llvm] [clang] Support VFE in thinLTO (PR #69735)

2023-11-06 Thread Teresa Johnson via cfe-commits
@@ -34,12 +40,223 @@ static cl::opt ClEnableVFE("enable-vfe", cl::Hidden, cl::init(true), cl::desc("Enable virtual function elimination")); +static cl::opt ClReadSummary( +"globaldce-read-summary", +cl::desc("Read summary from given bitcode before r