Skip to content

Commit 5701779

Browse files
committed
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.
1 parent e6f61be commit 5701779

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
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)