From 5701779b8e1ad05dc5eb165b4b00188fb43ebbf2 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Thu, 29 Mar 2018 09:41:41 +0200 Subject: [PATCH] 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. --- src/rustllvm/PassWrapper.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 8593f543619a5..3b400b879ebec 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -430,8 +430,9 @@ extern "C" void LLVMRustConfigurePassManagerBuilder( LLVMPassManagerBuilderRef PMBR, LLVMRustCodeGenOptLevel OptLevel, bool MergeFunctions, bool SLPVectorize, bool LoopVectorize, bool PrepareForThinLTO, const char* PGOGenPath, const char* PGOUsePath) { - // Ignore mergefunc for now as enabling it causes crashes. - // unwrap(PMBR)->MergeFunctions = MergeFunctions; +#if LLVM_RUSTLLVM + unwrap(PMBR)->MergeFunctions = MergeFunctions; +#endif unwrap(PMBR)->SLPVectorize = SLPVectorize; unwrap(PMBR)->OptLevel = fromRust(OptLevel); unwrap(PMBR)->LoopVectorize = LoopVectorize;