[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 13 22:28:58 PST 2025
================
@@ -1920,6 +1924,18 @@ Error LTO::runThinLTO(AddStreamFn AddStream, FileCache Cache,
ThinLTO.CombinedIndex, WholeProgramVisibilityEnabledInLTO,
DynamicExportSymbols, VisibleToRegularObjSymbols);
+ Triple TT(getTargetTriple());
+ DeadRTTIElimIndex(ThinLTO.CombinedIndex, TT).run();
+
+ if (!ThinLTO.CombinedIndex.withGlobalValueDeadStripping())
+ computeDeadSymbolsWithConstProp(ThinLTO.CombinedIndex, GUIDPreservedSymbols,
+ IsPrevailing, Conf.OptLevel > 0);
+
+
+ if (Conf.CombinedIndexHook &&
----------------
luxufan wrote:
Without this change, some existing test cases would fail. This is because the patch alters the position of the dead symbol analysis (moving it after DeadRTTIElimIndex). So this change makes the dumped index file still include information about dead symbols.
https://github.com/llvm/llvm-project/pull/126336
More information about the cfe-commits
mailing list