Skip to content

Commit a133a21

Browse files
committed
Add detailed comment.
1 parent 14ee5ff commit a133a21

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1456,7 +1456,17 @@ void DevirtModule::tryICallBranchFunnel(
14561456
if (!HasNonDevirt)
14571457
return;
14581458

1459-
// If any GV is AvailableExternally, drop to generate branch.funnel
1459+
// If any GV is AvailableExternally, not to generate branch.funnel.
1460+
// NOTE: It is to avoid crash in LowerTypeTest.
1461+
// If the branch.funnel is generated, because GV.isDeclarationForLinker(),
1462+
// in LowerTypeTestsModule::lower(), its GlobalTypeMember would NOT
1463+
// be saved in GlobalTypeMembers[&GV]. Then crash happens in
1464+
// buildBitSetsFromDisjointSet due to GlobalTypeMembers[&GV] is NULL.
1465+
// Even doing experiment to save it in GlobalTypeMembers[&GV] and
1466+
// making GlobalTypeMembers[&GV] be not NULL, crash could avoid from
1467+
// buildBitSetsFromDisjointSet. But still report_fatal_error in Verifier
1468+
// or SelectionDAGBuilder later, because operands linkage type consistency
1469+
// check of icall.branch.funnel can not pass.
14601470
for (auto &T : TargetsForSlot) {
14611471
if (T.TM->Bits->GV->hasAvailableExternallyLinkage())
14621472
return;

0 commit comments

Comments
 (0)