aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2023-03-24 17:34:14 -0700
committerShoaib Meenai <smeenai@fb.com>2023-03-25 21:37:42 -0700
commit377e1311d50c7e5b5aab3db081938e0d0ceebdfc (patch)
tree42695adc7a9504adff62416306a1a19664de54f4 /llvm/lib/LTO/LTO.cpp
parent943df86c82b1450bde45678757b7c39e459bc6ad (diff)
downloadllvm-377e1311d50c7e5b5aab3db081938e0d0ceebdfc.zip
llvm-377e1311d50c7e5b5aab3db081938e0d0ceebdfc.tar.gz
llvm-377e1311d50c7e5b5aab3db081938e0d0ceebdfc.tar.bz2
[ThinLTO] Only import for non-prevailing interposable global variables
This logic was added in https://reviews.llvm.org/D95943 specifically to handle an issue for non-prevailing global variables. It turns out that it adds a new issue for prevailing glboal variables, since those could be replaced by an available_externally definition and hence incorrectly omitted from the output object file. Limit the import to non-prevailing global variables to fix this, as suggested by @tejohnson. The bulk of the diff is mechanical changes to thread isPrevailing through to where it's needed and ensure it's available before the relevant calls; the actual logic change itself is straightforward. Fixes https://github.com/llvm/llvm-project/issues/61677 Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D146876
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index ee6b8c3..4d6a620 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -1553,7 +1553,7 @@ Error LTO::runThinLTO(AddStreamFn AddStream, FileCache Cache,
if (Conf.OptLevel > 0)
ComputeCrossModuleImport(ThinLTO.CombinedIndex, ModuleToDefinedGVSummaries,
- ImportLists, ExportLists);
+ isPrevailing, ImportLists, ExportLists);
// Figure out which symbols need to be internalized. This also needs to happen
// at -O0 because summary-based DCE is implemented using internalization, and