Skip to content

Commit 1b97480

Browse files
authored
Rollup merge of rust-lang#83037 - kubo39:merge-functions-in-llvm-new-pass-manager, r=nikic
Support merge_functions option in NewPM since LLVM >= 12 now we can pass this flag since https://reviews.llvm.org/D93002 has been merged.
2 parents c0033e5 + 65ed23c commit 1b97480

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+6-2
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)