1
Fork 0

Enable GVN by default.

This commit is contained in:
Camille GILLOT 2023-05-21 10:33:03 +00:00
parent 08cc634f1a
commit a03c972816
35 changed files with 389 additions and 534 deletions

View file

@ -109,7 +109,7 @@ pub struct GVN;
impl<'tcx> MirPass<'tcx> for GVN {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
sess.mir_opt_level() >= 4
sess.mir_opt_level() >= 2
}
#[instrument(level = "trace", skip(self, tcx, body))]

View file

@ -588,9 +588,9 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
// destroy the SSA property. It should still happen before const-propagation, so the
// latter pass will leverage the created opportunities.
&separate_const_switch::SeparateConstSwitch,
&const_prop::ConstProp,
&gvn::GVN,
&simplify::SimplifyLocals::AfterGVN,
&const_prop::ConstProp,
&dataflow_const_prop::DataflowConstProp,
&const_debuginfo::ConstDebugInfo,
&o1(simplify_branches::SimplifyConstCondition::AfterConstProp),