Support merge_functions option in NewPM since LLVM >= 12
now we can pass this flag since https://reviews.llvm.org/D93002 has been merged.
This commit is contained in:
parent
4a8b6f708c
commit
65ed23c282
1 changed files with 6 additions and 2 deletions
|
@ -772,14 +772,18 @@ LLVMRustOptimizeWithNewPassManager(
|
||||||
TargetMachine *TM = unwrap(TMRef);
|
TargetMachine *TM = unwrap(TMRef);
|
||||||
PassBuilder::OptimizationLevel OptLevel = fromRust(OptLevelRust);
|
PassBuilder::OptimizationLevel OptLevel = fromRust(OptLevelRust);
|
||||||
|
|
||||||
// FIXME: MergeFunctions is not supported by NewPM yet.
|
|
||||||
(void) MergeFunctions;
|
|
||||||
|
|
||||||
PipelineTuningOptions PTO;
|
PipelineTuningOptions PTO;
|
||||||
PTO.LoopUnrolling = UnrollLoops;
|
PTO.LoopUnrolling = UnrollLoops;
|
||||||
PTO.LoopInterleaving = UnrollLoops;
|
PTO.LoopInterleaving = UnrollLoops;
|
||||||
PTO.LoopVectorization = LoopVectorize;
|
PTO.LoopVectorization = LoopVectorize;
|
||||||
PTO.SLPVectorization = SLPVectorize;
|
PTO.SLPVectorization = SLPVectorize;
|
||||||
|
#if LLVM_VERSION_GE(12, 0)
|
||||||
|
PTO.MergeFunctions = MergeFunctions;
|
||||||
|
#else
|
||||||
|
// MergeFunctions is not supported by NewPM in older LLVM versions.
|
||||||
|
(void) MergeFunctions;
|
||||||
|
#endif
|
||||||
|
|
||||||
// FIXME: We may want to expose this as an option.
|
// FIXME: We may want to expose this as an option.
|
||||||
bool DebugPassManager = false;
|
bool DebugPassManager = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue