summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2020-01-13 13:50:41 -0800
committerTeresa Johnson <tejohnson@google.com>2020-01-14 10:57:14 -0800
commit2cefb93951cca01dcdde6fe5c7354dc8bcd796d6 (patch)
treed0a97d42a4d00506c64559a2e39aea89f71ab079 /llvm/lib
parentbec1b55c64cf33d5f33c8cb7cc10d02e25811bef (diff)
downloadbcm5719-llvm-2cefb93951cca01dcdde6fe5c7354dc8bcd796d6.tar.gz
bcm5719-llvm-2cefb93951cca01dcdde6fe5c7354dc8bcd796d6.zip
[ThinLTO/WPD] Remove an overly-aggressive assert
Summary: An assert added to the index-based WPD was trying to verify that we only have multiple vtables for a given guid when they are all non-external linkage. This is too conservative because we may have multiple external vtable with the same guid when they are in comdat. Remove the assert, as we don't have comdat information in the index, the linker should issue an error in this case. See discussion on D71040 for more information. Reviewers: evgeny777, aganea Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72648
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
index 3aa06a91b84..5ccfb29b01a 100644
--- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
+++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
@@ -843,18 +843,13 @@ bool DevirtIndex::tryFindVirtualCallTargets(
std::vector<ValueInfo> &TargetsForSlot, const TypeIdCompatibleVtableInfo TIdInfo,
uint64_t ByteOffset) {
for (const TypeIdOffsetVtableInfo &P : TIdInfo) {
- // Ensure that we have at most one external linkage vtable initializer.
- assert(P.VTableVI.getSummaryList().size() == 1 ||
- llvm::count_if(
- P.VTableVI.getSummaryList(),
- [&](const std::unique_ptr<GlobalValueSummary> &Summary) {
- return GlobalValue::isExternalLinkage(Summary->linkage());
- }) <= 1);
// Find the first non-available_externally linkage vtable initializer.
// We can have multiple available_externally, linkonce_odr and weak_odr
// vtable initializers, however we want to skip available_externally as they
// do not have type metadata attached, and therefore the summary will not
- // contain any vtable functions.
+ // contain any vtable functions. We can also have multiple external
+ // vtable initializers in the case of comdats, which we cannot check here.
+ // The linker should give an error in this case.
//
// Also, handle the case of same-named local Vtables with the same path
// and therefore the same GUID. This can happen if there isn't enough
OpenPOWER on IntegriCloud