Skip to content
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

PassWrapper: update for LLVM change D102093 #85416

Merged
merged 1 commit into from
May 21, 2021
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
13 changes: 12 additions & 1 deletion compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,16 +789,23 @@ LLVMRustOptimizeWithNewPassManager(
PGOOpt = PGOOptions(PGOUsePath, "", "", PGOOptions::IRUse);
}

#if LLVM_VERSION_GE(12, 0)
#if LLVM_VERSION_GE(12, 0) && !LLVM_VERSION_GE(13,0)
PassBuilder PB(DebugPassManager, TM, PTO, PGOOpt, &PIC);
#else
PassBuilder PB(TM, PTO, PGOOpt, &PIC);
#endif

#if LLVM_VERSION_GE(13, 0)
LoopAnalysisManager LAM;
FunctionAnalysisManager FAM;
CGSCCAnalysisManager CGAM;
ModuleAnalysisManager MAM;
#else
LoopAnalysisManager LAM(DebugPassManager);
FunctionAnalysisManager FAM(DebugPassManager);
CGSCCAnalysisManager CGAM(DebugPassManager);
ModuleAnalysisManager MAM(DebugPassManager);
#endif

FAM.registerPass([&] { return PB.buildDefaultAAPipeline(); });

Expand Down Expand Up @@ -935,7 +942,11 @@ LLVMRustOptimizeWithNewPassManager(
}
}

#if LLVM_VERSION_GE(13, 0)
ModulePassManager MPM;
#else
ModulePassManager MPM(DebugPassManager);
#endif
bool NeedThinLTOBufferPasses = UseThinLTOBuffers;
if (!NoPrepopulatePasses) {
if (OptLevel == PassBuilder::OptimizationLevel::O0) {
Expand Down