about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-10-07 00:16:08 +0200
committerGitHub <noreply@github.com>2020-10-07 00:16:08 +0200
commit6b4dbb196c45dd86c65813cd22ab11a19090e11c (patch)
treeda1f44319d3849c7538b44bafbdeb88df59dfffb
parent5314c72de88a0c8da60e2999c8b555d44b9967f2 (diff)
parentaf4b13283f6632de73a2176371f4e381b396e1ec (diff)
downloadrust-6b4dbb196c45dd86c65813cd22ab11a19090e11c.tar.gz
rust-6b4dbb196c45dd86c65813cd22ab11a19090e11c.zip
Rollup merge of #77582 - ecstatic-morse:disable-early-otherwise-branch, r=wesleywiser
Move `EarlyOtherwiseBranch` to mir-opt-level 2

cc #75119

This didn't have an [effect in most cases](https://perf.rust-lang.org/compare.html?start=81e02708f1f4760244756548981277d5199baa9a&end=2e0edc0f28c5647141bedba02e7a222d3a5dc9c3&stat=instructions:u), and is not trivially sound. Let it bake at `mir-opt-level=2` for a while.

Also, this missed the cutoff for beta, so we'll have to backport this.
r? @wesleywiser
-rw-r--r--compiler/rustc_mir/src/transform/early_otherwise_branch.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir/src/transform/early_otherwise_branch.rs b/compiler/rustc_mir/src/transform/early_otherwise_branch.rs
index a45b0e86fff..237a5c7864b 100644
--- a/compiler/rustc_mir/src/transform/early_otherwise_branch.rs
+++ b/compiler/rustc_mir/src/transform/early_otherwise_branch.rs
@@ -26,7 +26,7 @@ pub struct EarlyOtherwiseBranch;
 
 impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch {
     fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
-        if tcx.sess.opts.debugging_opts.mir_opt_level < 1 {
+        if tcx.sess.opts.debugging_opts.mir_opt_level < 2 {
             return;
         }
         trace!("running EarlyOtherwiseBranch on {:?}", body.source);