Skip to content

Commit e1151c9

Browse files
committed
Auto merge of #49479 - nox:merge-funcs, r=nagisa
Reenable the MergeFunctions pass The crash that happened in #23566 doesn't happen anymore with the LLVM mergefunc pass enabled and it hugely reduces code size (for example it shaves off 10% of the final Servo executable). This patch reenables it. For those wondering, [here are the docs from LLVM about this pass](http://llvm.org/docs/MergeFunctions.html).
2 parents 0e325d0 + 5701779 commit e1151c9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/rustllvm/PassWrapper.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,9 @@ extern "C" void LLVMRustConfigurePassManagerBuilder(
430430
LLVMPassManagerBuilderRef PMBR, LLVMRustCodeGenOptLevel OptLevel,
431431
bool MergeFunctions, bool SLPVectorize, bool LoopVectorize, bool PrepareForThinLTO,
432432
const char* PGOGenPath, const char* PGOUsePath) {
433-
// Ignore mergefunc for now as enabling it causes crashes.
434-
// unwrap(PMBR)->MergeFunctions = MergeFunctions;
433+
#if LLVM_RUSTLLVM
434+
unwrap(PMBR)->MergeFunctions = MergeFunctions;
435+
#endif
435436
unwrap(PMBR)->SLPVectorize = SLPVectorize;
436437
unwrap(PMBR)->OptLevel = fromRust(OptLevel);
437438
unwrap(PMBR)->LoopVectorize = LoopVectorize;

0 commit comments

Comments
 (0)