File tree 1 file changed +6
-2
lines changed
compiler/rustc_llvm/llvm-wrapper
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -772,14 +772,18 @@ LLVMRustOptimizeWithNewPassManager(
772
772
TargetMachine *TM = unwrap (TMRef);
773
773
PassBuilder::OptimizationLevel OptLevel = fromRust (OptLevelRust);
774
774
775
- // FIXME: MergeFunctions is not supported by NewPM yet.
776
- (void ) MergeFunctions;
777
775
778
776
PipelineTuningOptions PTO;
779
777
PTO.LoopUnrolling = UnrollLoops;
780
778
PTO.LoopInterleaving = UnrollLoops;
781
779
PTO.LoopVectorization = LoopVectorize;
782
780
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
783
787
784
788
// FIXME: We may want to expose this as an option.
785
789
bool DebugPassManager = false ;
You can’t perform that action at this time.
0 commit comments