about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2020-02-03 13:32:59 +1100
committerNicholas Nethercote <nnethercote@mozilla.com>2020-02-03 13:34:51 +1100
commitd62b6f204733d255a3e943388ba99f14b053bf4a (patch)
tree159bb458f39bf38d73f7de9b50e843525552ecb6
parent0eb297d3e04e618b96e668e8e9ed9ddf66d671fb (diff)
downloadrust-d62b6f204733d255a3e943388ba99f14b053bf4a.tar.gz
rust-d62b6f204733d255a3e943388ba99f14b053bf4a.zip
Pull out a special case in `merge_from_succ`.
This is a small perf win.
-rw-r--r--src/librustc_passes/liveness.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_passes/liveness.rs b/src/librustc_passes/liveness.rs
index 606947bfbdd..b355a47c394 100644
--- a/src/librustc_passes/liveness.rs
+++ b/src/librustc_passes/liveness.rs
@@ -824,6 +824,12 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
 
         let mut any_changed = false;
         self.indices2(ln, succ_ln, |this, idx, succ_idx| {
+            // This is a special case, pulled out from the code below, where we
+            // don't have to do anything. It occurs about 60-70% of the time.
+            if this.rwu_table.packed_rwus[succ_idx] == INV_INV_FALSE {
+                return;
+            }
+
             let mut changed = false;
             let mut rwu = this.rwu_table.get(idx);
             let succ_rwu = this.rwu_table.get(succ_idx);