aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2023-06-23 11:01:22 -0700
committerTeresa Johnson <tejohnson@google.com>2023-06-23 17:05:07 -0700
commit200cc952a28a73687ba24d5334415df6332f2d5b (patch)
treed40e9bca8ac572911b69ddbe96a104c4555b33d3 /llvm/lib/LTO/LTO.cpp
parenta2a4b605e2aada7fff2d88b830e420f966e0a16e (diff)
downloadllvm-200cc952a28a73687ba24d5334415df6332f2d5b.zip
llvm-200cc952a28a73687ba24d5334415df6332f2d5b.tar.gz
llvm-200cc952a28a73687ba24d5334415df6332f2d5b.tar.bz2
[LTO][GlobalDCE] Use pass parameter instead of module flag for LTO phase
D63932 added a module flag to indicate that we are executing the regular LTO post merge pipeline, so that GlobalDCE could perform more aggressive optimization for Dead Virtual Function Elimination. This caused issues trying to reuse bitcode that had already been through the LTO pipeline (see context in D139816). Instead support this by passing down a parameter flag to the GlobalDCEPass constructor, which is the more usual way for indicating this information. Most test changes are to remove incidental uses of this flag. Of the 2 real uses, llvm/test/LTO/ARM/lto-linking-metadata.ll is now obsolete and removed in this patch, and the virtual-functions-visibility-post-lto.ll test is updated to use the regular LTO default pipeline where this parameter is set to true. Differential Revision: https://reviews.llvm.org/D153655
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 9f3bff5..6b82c4e 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -1290,8 +1290,6 @@ Error LTO::runRegularLTO(AddStreamFn AddStream) {
GV->setLinkage(GlobalValue::InternalLinkage);
}
- RegularLTO.CombinedModule->addModuleFlag(Module::Error, "LTOPostLink", 1);
-
if (Conf.PostInternalizeModuleHook &&
!Conf.PostInternalizeModuleHook(0, *RegularLTO.CombinedModule))
return finalizeOptimizationRemarks(std::move(DiagnosticOutputFile));