summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2018-07-23 21:58:19 +0000
committerTeresa Johnson <tejohnson@google.com>2018-07-23 21:58:19 +0000
commite214fdeb69244a3e0c77343d791e761694f2c3b0 (patch)
treee5dd01f71b38bd88f95a6bcbbbf4692950e04170 /llvm/lib/Transforms
parent5a16f861e9cbb2e79012d7a6228ea8e68bec3f26 (diff)
downloadbcm5719-llvm-e214fdeb69244a3e0c77343d791e761694f2c3b0.tar.gz
bcm5719-llvm-e214fdeb69244a3e0c77343d791e761694f2c3b0.zip
[ThinLTO] Ensure the TargetLibraryInfo is constructed early enough
Summary: Without this change, the WholeProgramDevirt pass, which requires the TargetLibraryInfo, will construct one from the default triple. Fixes PR38139. Reviewers: pcc Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D49278 llvm-svn: 337750
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 52fdc737a75..5ced6481996 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -903,6 +903,8 @@ void PassManagerBuilder::addLateLTOOptimizationPasses(
void PassManagerBuilder::populateThinLTOPassManager(
legacy::PassManagerBase &PM) {
PerformThinLTO = true;
+ if (LibraryInfo)
+ PM.add(new TargetLibraryInfoWrapperPass(*LibraryInfo));
if (VerifyInput)
PM.add(createVerifierPass());
OpenPOWER on IntegriCloud