Skip to content

[CodeGen][LTO] Rename some misleading variables #65185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions clang/lib/CodeGen/BackendUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
// configure the pipeline.
OptimizationLevel Level = mapToLevel(CodeGenOpts);

bool IsThinLTO = CodeGenOpts.PrepareForThinLTO;
bool IsLTO = CodeGenOpts.PrepareForLTO;
const bool PrepareForThinLTO = CodeGenOpts.PrepareForThinLTO;
const bool PrepareForLTO = CodeGenOpts.PrepareForLTO;

if (LangOpts.ObjCAutoRefCount) {
PB.registerPipelineStartEPCallback(
Expand Down Expand Up @@ -1017,14 +1017,13 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
});
}

bool IsThinOrUnifiedLTO = IsThinLTO || (IsLTO && CodeGenOpts.UnifiedLTO);
if (CodeGenOpts.FatLTO) {
MPM = PB.buildFatLTODefaultPipeline(Level, IsThinOrUnifiedLTO,
IsThinOrUnifiedLTO ||
MPM = PB.buildFatLTODefaultPipeline(Level, PrepareForThinLTO,
PrepareForThinLTO ||
shouldEmitRegularLTOSummary());
} else if (IsThinOrUnifiedLTO) {
} else if (PrepareForThinLTO) {
MPM = PB.buildThinLTOPreLinkDefaultPipeline(Level);
} else if (IsLTO) {
} else if (PrepareForLTO) {
MPM = PB.buildLTOPreLinkDefaultPipeline(Level);
} else {
MPM = PB.buildPerModuleDefaultPipeline(Level);
Expand Down Expand Up @@ -1081,12 +1080,9 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
if (CodeGenOpts.FatLTO) {
// Set module flags, like EnableSplitLTOUnit and UnifiedLTO, since FatLTO
// uses a different action than Backend_EmitBC or Backend_EmitLL.
bool IsThinOrUnifiedLTO =
CodeGenOpts.PrepareForThinLTO ||
(CodeGenOpts.PrepareForLTO && CodeGenOpts.UnifiedLTO);
if (!TheModule->getModuleFlag("ThinLTO"))
TheModule->addModuleFlag(Module::Error, "ThinLTO",
uint32_t(IsThinOrUnifiedLTO));
uint32_t(CodeGenOpts.PrepareForThinLTO));
if (!TheModule->getModuleFlag("EnableSplitLTOUnit"))
TheModule->addModuleFlag(Module::Error, "EnableSplitLTOUnit",
uint32_t(CodeGenOpts.EnableSplitLTOUnit));
Expand Down