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(
10041004#endif
10051005 bool NeedThinLTOBufferPasses = UseThinLTOBuffers;
10061006 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) {
10081011#if LLVM_VERSION_GE(12, 0)
10091012 for (const auto &C : PipelineStartEPCallbacks)
10101013 PB.registerPipelineStartEPCallback (C);
You can’t perform that action at this time.
0 commit comments