about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2018-03-29 09:41:41 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2018-05-15 21:10:40 +0200
commit5701779b8e1ad05dc5eb165b4b00188fb43ebbf2 (patch)
tree6a546d35ee5fa93e8036cbb941eec697abd72fc2 /src/rustllvm/PassWrapper.cpp
parente6f61be4cdf511d4ed19275e881325f1956fead3 (diff)
downloadrust-5701779b8e1ad05dc5eb165b4b00188fb43ebbf2.tar.gz
rust-5701779b8e1ad05dc5eb165b4b00188fb43ebbf2.zip
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.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
-rw-r--r--src/rustllvm/PassWrapper.cpp5
1 files changed, 3 insertions, 2 deletions
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;