summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2017-09-20 17:09:47 +0000
committerTeresa Johnson <tejohnson@google.com>2017-09-20 17:09:47 +0000
commitf625118ec79e5c206e2a5ba9a2045b622937cee8 (patch)
tree78d8b12c016e9df6087bb41d8550157c94e8a658 /llvm/lib
parent897836373571b13a8142975dc360ac3538c7b574 (diff)
downloadbcm5719-llvm-f625118ec79e5c206e2a5ba9a2045b622937cee8.tar.gz
bcm5719-llvm-f625118ec79e5c206e2a5ba9a2045b622937cee8.zip
[ThinLTO] Fix dead stripping analysis for SamplePGO
Summary: The fix for dead stripping analysis in the case of SamplePGO indirect calls to local functions (r313151) introduced the possibility of an infinite loop. Make sure we check for the value being already live after we update it for SamplePGO indirect call handling. Reviewers: danielcdh Subscribers: mehdi_amini, inglorion, llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D38086 llvm-svn: 313766
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionImport.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index 9f20cbc6fed..670a84862e0 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -463,9 +463,6 @@ void llvm::computeDeadSymbols(
// Make value live and add it to the worklist if it was not live before.
// FIXME: we should only make the prevailing copy live here
auto visit = [&](ValueInfo VI) {
- for (auto &S : VI.getSummaryList())
- if (S->isLive())
- return;
// FIXME: If we knew which edges were created for indirect call profiles,
// we could skip them here. Any that are live should be reached via
// other edges, e.g. reference edges. Otherwise, using a profile collected
@@ -478,6 +475,9 @@ void llvm::computeDeadSymbols(
if (!VI)
return;
for (auto &S : VI.getSummaryList())
+ if (S->isLive())
+ return;
+ for (auto &S : VI.getSummaryList())
S->setLive(true);
++LiveSymbols;
Worklist.push_back(VI);
OpenPOWER on IntegriCloud