================
@@ -1629,6 +1630,23 @@ 
PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
   if (!LTOPreLink)
     MPM.addPass(RelLookupTableConverterPass());
 
+  if (PTO.WholeProgramDevirt && LTOPhase == ThinOrFullLTOPhase::None) {
+    MPM.addPass(WholeProgramDevirtPass(/*ExportSummary*/ nullptr,
+                                       /*ImportSummary*/ nullptr,
+                                       /*InLTOMode=*/false));
+    MPM.addPass(LowerTypeTestsPass(nullptr, nullptr,
+                                   lowertypetests::DropTestKind::Assume));
+    if (EnableModuleInliner) {
+      MPM.addPass(ModuleInlinerPass(getInlineParamsFromOptLevel(Level),
----------------
hassnaaHamdi wrote:

It seems that the passes that eliminate the unused GVs are depending on the 
inliner where constructors get inlined so it becomes clear which GVs are used 
and which are not.
And the WPD needs single GV user of the vtable that contains the virtual 
function we need to devirtualize. 
So WPD depends on (GlobalOpt/GlobalDCE) which depend on the inliner.

https://github.com/llvm/llvm-project/pull/145031
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to