Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/LTO/LTOBackend.cpp
//===-LTOBackend.cpp - LLVM Link Time Optimizer Backend -------------------===// | //===-LTOBackend.cpp - LLVM Link Time Optimizer Backend -------------------===// | ||||
Lint: Lint: clang-format not found in user's PATH; not linting file. | |||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
▲ Show 20 Lines • Show All 288 Lines • ▼ Show 20 Lines | static void runNewPMCustomPasses(const Config &Conf, Module &Mod, | ||||
RegisterPassPlugins(Conf.PassPlugins, PB); | RegisterPassPlugins(Conf.PassPlugins, PB); | ||||
LoopAnalysisManager LAM; | LoopAnalysisManager LAM; | ||||
FunctionAnalysisManager FAM; | FunctionAnalysisManager FAM; | ||||
CGSCCAnalysisManager CGAM; | CGSCCAnalysisManager CGAM; | ||||
ModuleAnalysisManager MAM; | ModuleAnalysisManager MAM; | ||||
std::unique_ptr<TargetLibraryInfoImpl> TLII(new TargetLibraryInfoImpl(Triple(TM->getTargetTriple()))); | |||||
Lint: Pre-merge checks clang-format: please reformat the code - std::unique_ptr<TargetLibraryInfoImpl> TLII(new TargetLibraryInfoImpl(Triple(TM->getTargetTriple()))); + std::unique_ptr<TargetLibraryInfoImpl> TLII( + new TargetLibraryInfoImpl(Triple(TM->getTargetTriple()))); Lint: Pre-merge checks: clang-format: please reformat the code
```
- std::unique_ptr<TargetLibraryInfoImpl> TLII(new… | |||||
if (Conf.Freestanding) | |||||
TLII->disableAllFunctions(); | |||||
fhahnAuthorUnsubmitted @asbirlea I am trying to make the new PM use a TargetLibraryInfo with all functions disabled here. But for some reason, it appears as if the custom TLI is not used. Do you have any idea what the right way to do that would be? fhahn: @asbirlea I am trying to make the new PM use a TargetLibraryInfo with all functions disabled… | |||||
aeubanksUnsubmitted Not Done ReplyInline ActionsI think you want runNewPMPasses on top of runNewPMCustomPasses (idk how much runNewPMCustomPasses is used). aeubanks: I think you want `runNewPMPasses` on top of `runNewPMCustomPasses` (idk how much… | |||||
asbirleaUnsubmitted Not Done ReplyInline Actions^ add these changes to runNewPMPasses as well. asbirlea: ^ add these changes to `runNewPMPasses` as well. | |||||
fhahnAuthorUnsubmitted Ah, there are 2 helpers for the NewPM, thanks! fhahn: Ah, there are 2 helpers for the `NewPM`, thanks! | |||||
FAM.registerPass([&] { return TargetLibraryAnalysis(*TLII); }); | |||||
// Register the AA manager first so that our version is the one used. | // Register the AA manager first so that our version is the one used. | ||||
FAM.registerPass([&] { return std::move(AA); }); | FAM.registerPass([&] { return std::move(AA); }); | ||||
// Register all the basic analyses with the managers. | // Register all the basic analyses with the managers. | ||||
PB.registerModuleAnalyses(MAM); | PB.registerModuleAnalyses(MAM); | ||||
PB.registerCGSCCAnalyses(CGAM); | PB.registerCGSCCAnalyses(CGAM); | ||||
PB.registerFunctionAnalyses(FAM); | PB.registerFunctionAnalyses(FAM); | ||||
PB.registerLoopAnalyses(LAM); | PB.registerLoopAnalyses(LAM); | ||||
Show All 17 Lines | |||||
static void runOldPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM, | static void runOldPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM, | ||||
bool IsThinLTO, ModuleSummaryIndex *ExportSummary, | bool IsThinLTO, ModuleSummaryIndex *ExportSummary, | ||||
const ModuleSummaryIndex *ImportSummary) { | const ModuleSummaryIndex *ImportSummary) { | ||||
legacy::PassManager passes; | legacy::PassManager passes; | ||||
passes.add(createTargetTransformInfoWrapperPass(TM->getTargetIRAnalysis())); | passes.add(createTargetTransformInfoWrapperPass(TM->getTargetIRAnalysis())); | ||||
PassManagerBuilder PMB; | PassManagerBuilder PMB; | ||||
PMB.LibraryInfo = new TargetLibraryInfoImpl(Triple(TM->getTargetTriple())); | PMB.LibraryInfo = new TargetLibraryInfoImpl(Triple(TM->getTargetTriple())); | ||||
if (Conf.Freestanding) | |||||
PMB.LibraryInfo->disableAllFunctions(); | |||||
PMB.Inliner = createFunctionInliningPass(); | PMB.Inliner = createFunctionInliningPass(); | ||||
PMB.ExportSummary = ExportSummary; | PMB.ExportSummary = ExportSummary; | ||||
PMB.ImportSummary = ImportSummary; | PMB.ImportSummary = ImportSummary; | ||||
// Unconditionally verify input since it is not verified before this | // Unconditionally verify input since it is not verified before this | ||||
// point and has unknown origin. | // point and has unknown origin. | ||||
PMB.VerifyInput = true; | PMB.VerifyInput = true; | ||||
PMB.VerifyOutput = !Conf.DisableVerify; | PMB.VerifyOutput = !Conf.DisableVerify; | ||||
PMB.LoopVectorize = true; | PMB.LoopVectorize = true; | ||||
▲ Show 20 Lines • Show All 385 Lines • Show Last 20 Lines |
clang-format not found in user's PATH; not linting file.