From 9fe5e261ea407da5a6dee7b6f758bef82578e61b Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Thu, 21 Nov 2019 22:41:23 -0800 Subject: [PATCH] Update the LLVM pass list. Adds optimizations of loops, and inlinling and some simple interprocedural optimization. --- lib/llvm-backend/src/code.rs | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/lib/llvm-backend/src/code.rs b/lib/llvm-backend/src/code.rs index 0aca84650..4785cb569 100644 --- a/lib/llvm-backend/src/code.rs +++ b/lib/llvm-backend/src/code.rs @@ -8290,21 +8290,37 @@ impl ModuleCodeGenerator pass_manager.add_verifier_pass(); } pass_manager.add_type_based_alias_analysis_pass(); + pass_manager.add_ipsccp_pass(); + pass_manager.add_prune_eh_pass(); + pass_manager.add_dead_arg_elimination_pass(); + pass_manager.add_function_inlining_pass(); pass_manager.add_lower_expect_intrinsic_pass(); pass_manager.add_scalar_repl_aggregates_pass(); pass_manager.add_instruction_combining_pass(); - pass_manager.add_cfg_simplification_pass(); - pass_manager.add_gvn_pass(); pass_manager.add_jump_threading_pass(); pass_manager.add_correlated_value_propagation_pass(); - pass_manager.add_sccp_pass(); + pass_manager.add_cfg_simplification_pass(); + pass_manager.add_reassociate_pass(); + pass_manager.add_loop_rotate_pass(); + pass_manager.add_loop_unswitch_pass(); + pass_manager.add_ind_var_simplify_pass(); + pass_manager.add_licm_pass(); + pass_manager.add_loop_vectorize_pass(); + pass_manager.add_instruction_combining_pass(); + pass_manager.add_ipsccp_pass(); + pass_manager.add_reassociate_pass(); + pass_manager.add_cfg_simplification_pass(); + pass_manager.add_gvn_pass(); + pass_manager.add_memcpy_optimize_pass(); + pass_manager.add_dead_store_elimination_pass(); + pass_manager.add_bit_tracking_dce_pass(); pass_manager.add_instruction_combining_pass(); pass_manager.add_reassociate_pass(); pass_manager.add_cfg_simplification_pass(); - pass_manager.add_bit_tracking_dce_pass(); pass_manager.add_slp_vectorize_pass(); - pass_manager.run_on(&*self.module.borrow_mut()); + pass_manager.add_early_cse_pass(); + pass_manager.run_on(&*self.module.borrow_mut()); if let Some(path) = unsafe { &crate::GLOBAL_OPTIONS.post_opt_ir } { self.module.borrow_mut().print_to_file(path).unwrap(); }