From 22acf72936d43e225c2b9bb6a0883b933c55a698 Mon Sep 17 00:00:00 2001 From: Timotej Kapus Date: Tue, 21 May 2019 00:35:39 -0700 Subject: [PATCH] [sledge] fix only-needed Reviewed By: jberdine Differential Revision: D15420742 fbshipit-source-id: 7332f849d --- sledge/src/llair/dune.in | 2 +- sledge/src/llair/frontend.ml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sledge/src/llair/dune.in b/sledge/src/llair/dune.in index 72cc05913..9597a3cef 100644 --- a/sledge/src/llair/dune.in +++ b/sledge/src/llair/dune.in @@ -16,7 +16,7 @@ Jbuild_plugin.V1.send (name llair_) (public_name llair) %s - (libraries ctypes ctypes.foreign llvm llvm.irreader llvm.analysis llvm.scalar_opts llvm.target %s)) + (libraries ctypes ctypes.foreign llvm llvm.irreader llvm.analysis llvm.scalar_opts llvm.target llvm.ipo %s)) |} (flags `lib deps) (libraries deps) diff --git a/sledge/src/llair/frontend.ml b/sledge/src/llair/frontend.ml index fbbd16248..ddc1a29e8 100644 --- a/sledge/src/llair/frontend.ml +++ b/sledge/src/llair/frontend.ml @@ -1335,6 +1335,7 @@ let xlate_function : x -> Llvm.llvalue -> Llair.func = let transform : Llvm.llmodule -> unit = fun llmodule -> let pm = Llvm.PassManager.create () in + Llvm_ipo.add_global_dce pm ; Llvm_scalar_opts.add_lower_atomic pm ; Llvm_scalar_opts.add_scalar_repl_aggregation pm ; Llvm_scalar_opts.add_scalarizer pm ;