File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
compiler/rustc_llvm/llvm-wrapper Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -772,14 +772,18 @@ LLVMRustOptimizeWithNewPassManager(
772772 TargetMachine *TM = unwrap (TMRef);
773773 PassBuilder::OptimizationLevel OptLevel = fromRust (OptLevelRust);
774774
775- // FIXME: MergeFunctions is not supported by NewPM yet.
776- (void ) MergeFunctions;
777775
778776 PipelineTuningOptions PTO;
779777 PTO.LoopUnrolling = UnrollLoops;
780778 PTO.LoopInterleaving = UnrollLoops;
781779 PTO.LoopVectorization = LoopVectorize;
782780 PTO.SLPVectorization = SLPVectorize;
781+ #if LLVM_VERSION_GE(12, 0)
782+ PTO.MergeFunctions = MergeFunctions;
783+ #else
784+ // MergeFunctions is not supported by NewPM in older LLVM versions.
785+ (void ) MergeFunctions;
786+ #endif
783787
784788 // FIXME: We may want to expose this as an option.
785789 bool DebugPassManager = false ;
You can’t perform that action at this time.
0 commit comments