File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
compiler/rustc_llvm/llvm-wrapper Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1004,7 +1004,10 @@ LLVMRustOptimizeWithNewPassManager(
1004
1004
#endif
1005
1005
bool NeedThinLTOBufferPasses = UseThinLTOBuffers;
1006
1006
if (!NoPrepopulatePasses) {
1007
- if (OptLevel == OptimizationLevel::O0) {
1007
+ // The pre-link pipelines don't support O0 and require using budilO0DefaultPipeline() instead.
1008
+ // At the same time, the LTO pipelines do support O0 and using them is required.
1009
+ bool IsLTO = OptStage == LLVMRustOptStage::ThinLTO || OptStage == LLVMRustOptStage::FatLTO;
1010
+ if (OptLevel == OptimizationLevel::O0 && !IsLTO) {
1008
1011
#if LLVM_VERSION_GE(12, 0)
1009
1012
for (const auto &C : PipelineStartEPCallbacks)
1010
1013
PB.registerPipelineStartEPCallback (C);
You can’t perform that action at this time.
0 commit comments