about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-05-16 17:15:37 +0000
committerbors <bors@rust-lang.org>2018-05-16 17:15:37 +0000
commite1151c9819cca90e511f60757297629177272d16 (patch)
treeff8ac8ff7a25f21e383e6345bac77d2b37658621
parent0e325d0141ce8d86524f55c2df53835aab895096 (diff)
parent5701779b8e1ad05dc5eb165b4b00188fb43ebbf2 (diff)
downloadrust-e1151c9819cca90e511f60757297629177272d16.tar.gz
rust-e1151c9819cca90e511f60757297629177272d16.zip
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).
m---------src/llvm0
-rw-r--r--src/rustllvm/PassWrapper.cpp5
2 files changed, 3 insertions, 2 deletions
diff --git a/src/llvm b/src/llvm
-Subproject fd7dd99edf371ac502ae4e70288c027f6692ace
+Subproject 1abfd0e562cc8f7a9577d97ee92246699093b95
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index 8593f543619..3b400b879eb 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;