Skip to content

Commit f3954eb

Browse files
committed
remove HasLocalSummary var as the Summary doesn't get built in this patch
1 parent 5b686ad commit f3954eb

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,6 @@ struct WholeProgramDevirtPass : public PassInfoMixin<WholeProgramDevirtPass> {
226226
ModuleSummaryIndex *ExportSummary;
227227
const ModuleSummaryIndex *ImportSummary;
228228
bool UseCommandLine = false;
229-
// True if ExportSummary was built locally from the module rather than
230-
// provided externally to the pass (e.g., during LTO). Default value is false
231-
// unless explicitly set when the Summary is explicitly built.
232-
bool HasLocalSummary = false;
233229
WholeProgramDevirtPass()
234230
: ExportSummary(nullptr), ImportSummary(nullptr), UseCommandLine(true) {}
235231
WholeProgramDevirtPass(ModuleSummaryIndex *ExportSummary,

llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,6 @@ struct DevirtModule {
605605

606606
ModuleSummaryIndex *const ExportSummary;
607607
const ModuleSummaryIndex *const ImportSummary;
608-
// True if ExportSummary was built locally from the module.
609-
// Default is false unless explicitly set.
610-
const bool HasLocalSummary;
611608

612609
IntegerType *const Int8Ty;
613610
PointerType *const Int8PtrTy;
@@ -645,12 +642,10 @@ struct DevirtModule {
645642

646643
DevirtModule(Module &M, ModuleAnalysisManager &MAM,
647644
ModuleSummaryIndex *ExportSummary,
648-
const ModuleSummaryIndex *ImportSummary,
649-
bool HasLocalSummary = false)
645+
const ModuleSummaryIndex *ImportSummary)
650646
: M(M), MAM(MAM),
651647
FAM(MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager()),
652648
ExportSummary(ExportSummary), ImportSummary(ImportSummary),
653-
HasLocalSummary(HasLocalSummary),
654649
Int8Ty(Type::getInt8Ty(M.getContext())),
655650
Int8PtrTy(PointerType::getUnqual(M.getContext())),
656651
Int32Ty(Type::getInt32Ty(M.getContext())),
@@ -821,8 +816,7 @@ PreservedAnalyses WholeProgramDevirtPass::run(Module &M,
821816
return PreservedAnalyses::all();
822817
return PreservedAnalyses::none();
823818
}
824-
if (!DevirtModule(M, MAM, ExportSummary, ImportSummary, HasLocalSummary)
825-
.run())
819+
if (!DevirtModule(M, MAM, ExportSummary, ImportSummary).run())
826820
return PreservedAnalyses::all();
827821
return PreservedAnalyses::none();
828822
}
@@ -1363,10 +1357,10 @@ bool DevirtModule::trySingleImplDevirt(
13631357
if (!IsExported)
13641358
return false;
13651359

1366-
// If the only implementation has local linkage, we must promote
1367-
// to external to make it visible to thin LTO objects.
1368-
// This change should be safe only in LTO mode.
1369-
if (!HasLocalSummary && TheFn->hasLocalLinkage()) {
1360+
// If the only implementation has local linkage, we must promote to external
1361+
// to make it visible to thin LTO objects. We can only get here during the
1362+
// ThinLTO export phase.
1363+
if (TheFn->hasLocalLinkage()) {
13701364
std::string NewName = (TheFn->getName() + ".llvm.merged").str();
13711365

13721366
// Since we are renaming the function, any comdats with the same name must

0 commit comments

Comments
 (0)