mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 05:26:47 +00:00
Auto merge of #119439 - cjgillot:gvn-faster, r=oli-obk
Avoid some redundant work in GVN The first 2 commits are about reducing the perf effect. Third commit avoids doing redundant work: is a local is SSA, it already has been simplified, and the resulting value is in `self.locals`. No need to call any code on it. The last commit avoids removing some storage statements. r? wg-mir-opt
This commit is contained in:
commit
f9c2421a2a
@ -84,7 +84,7 @@
|
||||
|
||||
use rustc_const_eval::interpret::{intern_const_alloc_for_constprop, MemoryKind};
|
||||
use rustc_const_eval::interpret::{ImmTy, InterpCx, OpTy, Projectable, Scalar};
|
||||
use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
|
||||
use rustc_data_structures::fx::FxIndexSet;
|
||||
use rustc_data_structures::graph::dominators::Dominators;
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
@ -99,6 +99,7 @@ use rustc_middle::ty::{self, Ty, TyCtxt, TypeAndMut};
|
||||
use rustc_span::def_id::DefId;
|
||||
use rustc_span::DUMMY_SP;
|
||||
use rustc_target::abi::{self, Abi, Size, VariantIdx, FIRST_VARIANT};
|
||||
use smallvec::SmallVec;
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::dataflow_const_prop::DummyMachine;
|
||||
@ -238,14 +239,18 @@ struct VnState<'body, 'tcx> {
|
||||
local_decls: &'body LocalDecls<'tcx>,
|
||||
/// Value stored in each local.
|
||||
locals: IndexVec<Local, Option<VnIndex>>,
|
||||
/// First local to be assigned that value.
|
||||
rev_locals: FxHashMap<VnIndex, Vec<Local>>,
|
||||
/// Locals that are assigned that value.
|
||||
// This vector does not hold all the values of `VnIndex` that we create.
|
||||
// It stops at the largest value created in the first phase of collecting assignments.
|
||||
rev_locals: IndexVec<VnIndex, SmallVec<[Local; 1]>>,
|
||||
values: FxIndexSet<Value<'tcx>>,
|
||||
/// Values evaluated as constants if possible.
|
||||
evaluated: IndexVec<VnIndex, Option<OpTy<'tcx>>>,
|
||||
/// Counter to generate different values.
|
||||
/// This is an option to stop creating opaques during replacement.
|
||||
next_opaque: Option<usize>,
|
||||
/// Cache the value of the `unsized_locals` features, to avoid fetching it repeatedly in a loop.
|
||||
feature_unsized_locals: bool,
|
||||
ssa: &'body SsaLocals,
|
||||
dominators: &'body Dominators<BasicBlock>,
|
||||
reused_locals: BitSet<Local>,
|
||||
@ -265,10 +270,11 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
||||
param_env,
|
||||
local_decls,
|
||||
locals: IndexVec::from_elem(None, local_decls),
|
||||
rev_locals: FxHashMap::default(),
|
||||
rev_locals: IndexVec::default(),
|
||||
values: FxIndexSet::default(),
|
||||
evaluated: IndexVec::new(),
|
||||
next_opaque: Some(0),
|
||||
feature_unsized_locals: tcx.features().unsized_locals,
|
||||
ssa,
|
||||
dominators,
|
||||
reused_locals: BitSet::new_empty(local_decls.len()),
|
||||
@ -316,10 +322,11 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
||||
self.locals[local] = Some(value);
|
||||
|
||||
// Only register the value if its type is `Sized`, as we will emit copies of it.
|
||||
let is_sized = !self.tcx.features().unsized_locals
|
||||
let is_sized = !self.feature_unsized_locals
|
||||
|| self.local_decls[local].ty.is_sized(self.tcx, self.param_env);
|
||||
if is_sized {
|
||||
self.rev_locals.entry(value).or_default().push(local);
|
||||
self.rev_locals.ensure_contains_elem(value, SmallVec::new);
|
||||
self.rev_locals[value].push(local);
|
||||
}
|
||||
}
|
||||
|
||||
@ -630,6 +637,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
||||
if place.is_indirect()
|
||||
&& let Some(base) = self.locals[place.local]
|
||||
&& let Some(new_local) = self.try_as_local(base, location)
|
||||
&& place.local != new_local
|
||||
{
|
||||
place.local = new_local;
|
||||
self.reused_locals.insert(new_local);
|
||||
@ -639,8 +647,8 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
||||
|
||||
for i in 0..projection.len() {
|
||||
let elem = projection[i];
|
||||
if let ProjectionElem::Index(idx) = elem
|
||||
&& let Some(idx) = self.locals[idx]
|
||||
if let ProjectionElem::Index(idx_local) = elem
|
||||
&& let Some(idx) = self.locals[idx_local]
|
||||
{
|
||||
if let Some(offset) = self.evaluated[idx].as_ref()
|
||||
&& let Ok(offset) = self.ecx.read_target_usize(offset)
|
||||
@ -648,9 +656,11 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
||||
{
|
||||
projection.to_mut()[i] =
|
||||
ProjectionElem::ConstantIndex { offset, min_length, from_end: false };
|
||||
} else if let Some(new_idx) = self.try_as_local(idx, location) {
|
||||
projection.to_mut()[i] = ProjectionElem::Index(new_idx);
|
||||
self.reused_locals.insert(new_idx);
|
||||
} else if let Some(new_idx_local) = self.try_as_local(idx, location)
|
||||
&& idx_local != new_idx_local
|
||||
{
|
||||
projection.to_mut()[i] = ProjectionElem::Index(new_idx_local);
|
||||
self.reused_locals.insert(new_idx_local);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -986,11 +996,11 @@ impl<'tcx> VnState<'_, 'tcx> {
|
||||
/// If there is a local which is assigned `index`, and its assignment strictly dominates `loc`,
|
||||
/// return it.
|
||||
fn try_as_local(&mut self, index: VnIndex, loc: Location) -> Option<Local> {
|
||||
let other = self.rev_locals.get(&index)?;
|
||||
let other = self.rev_locals.get(index)?;
|
||||
other
|
||||
.iter()
|
||||
.find(|&&other| self.ssa.assignment_dominates(self.dominators, other, loc))
|
||||
.copied()
|
||||
.find(|&other| self.ssa.assignment_dominates(self.dominators, other, loc))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1008,23 +1018,32 @@ impl<'tcx> MutVisitor<'tcx> for VnState<'_, 'tcx> {
|
||||
}
|
||||
|
||||
fn visit_statement(&mut self, stmt: &mut Statement<'tcx>, location: Location) {
|
||||
if let StatementKind::Assign(box (_, ref mut rvalue)) = stmt.kind
|
||||
if let StatementKind::Assign(box (ref mut lhs, ref mut rvalue)) = stmt.kind {
|
||||
self.simplify_place_projection(lhs, location);
|
||||
|
||||
// Do not try to simplify a constant, it's already in canonical shape.
|
||||
&& !matches!(rvalue, Rvalue::Use(Operand::Constant(_)))
|
||||
{
|
||||
if let Some(value) = self.simplify_rvalue(rvalue, location) {
|
||||
if let Some(const_) = self.try_as_constant(value) {
|
||||
*rvalue = Rvalue::Use(Operand::Constant(Box::new(const_)));
|
||||
} else if let Some(local) = self.try_as_local(value, location)
|
||||
&& *rvalue != Rvalue::Use(Operand::Move(local.into()))
|
||||
{
|
||||
*rvalue = Rvalue::Use(Operand::Copy(local.into()));
|
||||
self.reused_locals.insert(local);
|
||||
}
|
||||
if matches!(rvalue, Rvalue::Use(Operand::Constant(_))) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
self.super_statement(stmt, location);
|
||||
|
||||
let value = lhs
|
||||
.as_local()
|
||||
.and_then(|local| self.locals[local])
|
||||
.or_else(|| self.simplify_rvalue(rvalue, location));
|
||||
let Some(value) = value else { return };
|
||||
|
||||
if let Some(const_) = self.try_as_constant(value) {
|
||||
*rvalue = Rvalue::Use(Operand::Constant(Box::new(const_)));
|
||||
} else if let Some(local) = self.try_as_local(value, location)
|
||||
&& *rvalue != Rvalue::Use(Operand::Move(local.into()))
|
||||
{
|
||||
*rvalue = Rvalue::Use(Operand::Copy(local.into()));
|
||||
self.reused_locals.insert(local);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
self.super_statement(stmt, location);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,10 @@ fn main() -> () {
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
nop;
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC9: &&[(Option<i32>, &[&str])]};
|
||||
_1 = (*_2);
|
||||
nop;
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
_0 = const ();
|
||||
return;
|
||||
|
@ -7,10 +7,10 @@ fn main() -> () {
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
nop;
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC9: &&[(Option<i32>, &[&str])]};
|
||||
_1 = (*_2);
|
||||
nop;
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
_0 = const ();
|
||||
return;
|
||||
|
@ -7,10 +7,10 @@ fn main() -> () {
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
nop;
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC9: &&[(Option<i32>, &[&u8])]};
|
||||
_1 = (*_2);
|
||||
nop;
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
_0 = const ();
|
||||
return;
|
||||
|
@ -7,10 +7,10 @@ fn main() -> () {
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
nop;
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC9: &&[(Option<i32>, &[&u8])]};
|
||||
_1 = (*_2);
|
||||
nop;
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
_0 = const ();
|
||||
return;
|
||||
|
@ -7,10 +7,10 @@ fn main() -> () {
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
nop;
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC4: &&Packed};
|
||||
_1 = (*_2);
|
||||
nop;
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
_0 = const ();
|
||||
return;
|
||||
|
@ -7,10 +7,10 @@ fn main() -> () {
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
nop;
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC2: &&Packed};
|
||||
_1 = (*_2);
|
||||
nop;
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
_0 = const ();
|
||||
return;
|
||||
|
@ -24,9 +24,8 @@
|
||||
bb0: {
|
||||
StorageLive(_2);
|
||||
- _2 = (const 1_i32, const false);
|
||||
- StorageLive(_3);
|
||||
+ _2 = const (1_i32, false);
|
||||
+ nop;
|
||||
StorageLive(_3);
|
||||
_3 = &raw mut (_2.1: bool);
|
||||
- _2 = (const 1_i32, const false);
|
||||
+ _2 = const (1_i32, false);
|
||||
@ -42,9 +41,8 @@
|
||||
StorageDead(_6);
|
||||
_0 = _5;
|
||||
- StorageDead(_5);
|
||||
- StorageDead(_3);
|
||||
+ nop;
|
||||
+ nop;
|
||||
StorageDead(_3);
|
||||
StorageDead(_2);
|
||||
return;
|
||||
}
|
||||
|
@ -22,18 +22,15 @@
|
||||
}
|
||||
|
||||
bb0: {
|
||||
- StorageLive(_1);
|
||||
+ nop;
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
- StorageLive(_3);
|
||||
+ nop;
|
||||
StorageLive(_3);
|
||||
_9 = const _;
|
||||
_3 = &(*_9);
|
||||
_2 = &raw const (*_3);
|
||||
_1 = move _2 as *const [i32] (PointerCoercion(Unsize));
|
||||
StorageDead(_2);
|
||||
- StorageDead(_3);
|
||||
+ nop;
|
||||
StorageDead(_3);
|
||||
StorageLive(_5);
|
||||
StorageLive(_6);
|
||||
_6 = const 3_usize;
|
||||
@ -50,8 +47,7 @@
|
||||
StorageDead(_6);
|
||||
_0 = const ();
|
||||
StorageDead(_5);
|
||||
- StorageDead(_1);
|
||||
+ nop;
|
||||
StorageDead(_1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -22,18 +22,15 @@
|
||||
}
|
||||
|
||||
bb0: {
|
||||
- StorageLive(_1);
|
||||
+ nop;
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
- StorageLive(_3);
|
||||
+ nop;
|
||||
StorageLive(_3);
|
||||
_9 = const _;
|
||||
_3 = &(*_9);
|
||||
_2 = &raw const (*_3);
|
||||
_1 = move _2 as *const [i32] (PointerCoercion(Unsize));
|
||||
StorageDead(_2);
|
||||
- StorageDead(_3);
|
||||
+ nop;
|
||||
StorageDead(_3);
|
||||
StorageLive(_5);
|
||||
StorageLive(_6);
|
||||
_6 = const 3_usize;
|
||||
@ -50,8 +47,7 @@
|
||||
StorageDead(_6);
|
||||
_0 = const ();
|
||||
StorageDead(_5);
|
||||
- StorageDead(_1);
|
||||
+ nop;
|
||||
StorageDead(_1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -22,18 +22,15 @@
|
||||
}
|
||||
|
||||
bb0: {
|
||||
- StorageLive(_1);
|
||||
+ nop;
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
- StorageLive(_3);
|
||||
+ nop;
|
||||
StorageLive(_3);
|
||||
_9 = const _;
|
||||
_3 = &(*_9);
|
||||
_2 = &raw const (*_3);
|
||||
_1 = move _2 as *const [i32] (PointerCoercion(Unsize));
|
||||
StorageDead(_2);
|
||||
- StorageDead(_3);
|
||||
+ nop;
|
||||
StorageDead(_3);
|
||||
StorageLive(_5);
|
||||
StorageLive(_6);
|
||||
_6 = const 3_usize;
|
||||
@ -50,8 +47,7 @@
|
||||
StorageDead(_6);
|
||||
_0 = const ();
|
||||
StorageDead(_5);
|
||||
- StorageDead(_1);
|
||||
+ nop;
|
||||
StorageDead(_1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -22,18 +22,15 @@
|
||||
}
|
||||
|
||||
bb0: {
|
||||
- StorageLive(_1);
|
||||
+ nop;
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
- StorageLive(_3);
|
||||
+ nop;
|
||||
StorageLive(_3);
|
||||
_9 = const _;
|
||||
_3 = &(*_9);
|
||||
_2 = &raw const (*_3);
|
||||
_1 = move _2 as *const [i32] (PointerCoercion(Unsize));
|
||||
StorageDead(_2);
|
||||
- StorageDead(_3);
|
||||
+ nop;
|
||||
StorageDead(_3);
|
||||
StorageLive(_5);
|
||||
StorageLive(_6);
|
||||
_6 = const 3_usize;
|
||||
@ -50,8 +47,7 @@
|
||||
StorageDead(_6);
|
||||
_0 = const ();
|
||||
StorageDead(_5);
|
||||
- StorageDead(_1);
|
||||
+ nop;
|
||||
StorageDead(_1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -22,12 +22,10 @@
|
||||
- _1 = (const 1_i32,);
|
||||
+ _1 = const (1_i32,);
|
||||
StorageLive(_2);
|
||||
- StorageLive(_3);
|
||||
+ nop;
|
||||
StorageLive(_3);
|
||||
_3 = &raw mut (_1.0: i32);
|
||||
(*_3) = const 5_i32;
|
||||
- StorageDead(_3);
|
||||
+ nop;
|
||||
StorageDead(_3);
|
||||
_2 = const ();
|
||||
StorageDead(_2);
|
||||
StorageLive(_4);
|
||||
|
@ -17,13 +17,11 @@
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
- _1 = (const 1_i32,);
|
||||
- StorageLive(_2);
|
||||
+ _1 = const (1_i32,);
|
||||
+ nop;
|
||||
StorageLive(_2);
|
||||
_2 = &mut (_1.0: i32);
|
||||
(*_2) = const 5_i32;
|
||||
- StorageDead(_2);
|
||||
+ nop;
|
||||
StorageDead(_2);
|
||||
StorageLive(_3);
|
||||
StorageLive(_4);
|
||||
_4 = (_1.0: i32);
|
||||
|
@ -33,10 +33,6 @@
|
||||
+ }
|
||||
+
|
||||
+ ALLOC1 (size: 2, align: 1) {
|
||||
+ 01 02 │ ..
|
||||
+ }
|
||||
+
|
||||
+ ALLOC2 (size: 2, align: 1) {
|
||||
+ 01 02 │ ..
|
||||
}
|
||||
|
||||
|
@ -33,10 +33,6 @@
|
||||
+ }
|
||||
+
|
||||
+ ALLOC1 (size: 2, align: 1) {
|
||||
+ 01 02 │ ..
|
||||
+ }
|
||||
+
|
||||
+ ALLOC2 (size: 2, align: 1) {
|
||||
+ 01 02 │ ..
|
||||
}
|
||||
|
||||
|
@ -19,17 +19,15 @@
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
- _1 = (const 42_i32, const 43_i32);
|
||||
- StorageLive(_2);
|
||||
+ _1 = const (42_i32, 43_i32);
|
||||
+ nop;
|
||||
StorageLive(_2);
|
||||
_2 = &mut _1;
|
||||
((*_2).1: i32) = const 99_i32;
|
||||
StorageLive(_3);
|
||||
_3 = _1;
|
||||
_0 = const ();
|
||||
StorageDead(_3);
|
||||
- StorageDead(_2);
|
||||
+ nop;
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
return;
|
||||
}
|
||||
|
@ -22,14 +22,12 @@
|
||||
_1 = const 42_u32;
|
||||
StorageLive(_2);
|
||||
StorageLive(_3);
|
||||
- StorageLive(_4);
|
||||
+ nop;
|
||||
StorageLive(_4);
|
||||
_4 = const {ALLOC0: *mut u32};
|
||||
_3 = (*_4);
|
||||
_1 = move _3;
|
||||
StorageDead(_3);
|
||||
- StorageDead(_4);
|
||||
+ nop;
|
||||
StorageDead(_4);
|
||||
_2 = const ();
|
||||
StorageDead(_2);
|
||||
StorageLive(_5);
|
||||
|
@ -16,14 +16,12 @@
|
||||
- StorageLive(_1);
|
||||
+ nop;
|
||||
StorageLive(_2);
|
||||
- StorageLive(_3);
|
||||
+ nop;
|
||||
StorageLive(_3);
|
||||
_3 = const _;
|
||||
_2 = &raw const (*_3);
|
||||
_1 = move _2 as usize (PointerExposeAddress);
|
||||
StorageDead(_2);
|
||||
- StorageDead(_3);
|
||||
+ nop;
|
||||
StorageDead(_3);
|
||||
StorageLive(_4);
|
||||
StorageLive(_5);
|
||||
_5 = _1;
|
||||
|
@ -16,14 +16,12 @@
|
||||
- StorageLive(_1);
|
||||
+ nop;
|
||||
StorageLive(_2);
|
||||
- StorageLive(_3);
|
||||
+ nop;
|
||||
StorageLive(_3);
|
||||
_3 = const _;
|
||||
_2 = &raw const (*_3);
|
||||
_1 = move _2 as usize (PointerExposeAddress);
|
||||
StorageDead(_2);
|
||||
- StorageDead(_3);
|
||||
+ nop;
|
||||
StorageDead(_3);
|
||||
StorageLive(_4);
|
||||
StorageLive(_5);
|
||||
_5 = _1;
|
||||
|
@ -13,14 +13,12 @@
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
- StorageLive(_2);
|
||||
+ nop;
|
||||
StorageLive(_2);
|
||||
_4 = const _;
|
||||
_2 = &(*_4);
|
||||
- _1 = (*_2);
|
||||
- StorageDead(_2);
|
||||
+ _1 = const 4_i32;
|
||||
+ nop;
|
||||
StorageDead(_2);
|
||||
_0 = const ();
|
||||
StorageDead(_1);
|
||||
return;
|
||||
|
@ -13,14 +13,12 @@
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
- StorageLive(_2);
|
||||
+ nop;
|
||||
StorageLive(_2);
|
||||
_4 = const _;
|
||||
_2 = &((*_4).1: i32);
|
||||
- _1 = (*_2);
|
||||
- StorageDead(_2);
|
||||
+ _1 = const 5_i32;
|
||||
+ nop;
|
||||
StorageDead(_2);
|
||||
_0 = const ();
|
||||
StorageDead(_1);
|
||||
return;
|
||||
|
@ -18,8 +18,7 @@
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
- StorageLive(_2);
|
||||
+ nop;
|
||||
StorageLive(_2);
|
||||
StorageLive(_3);
|
||||
StorageLive(_4);
|
||||
_9 = const _;
|
||||
@ -44,8 +43,7 @@
|
||||
+ _1 = (*_2)[1 of 2];
|
||||
StorageDead(_6);
|
||||
StorageDead(_4);
|
||||
- StorageDead(_2);
|
||||
+ nop;
|
||||
StorageDead(_2);
|
||||
_0 = const ();
|
||||
StorageDead(_1);
|
||||
return;
|
||||
|
@ -18,8 +18,7 @@
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
- StorageLive(_2);
|
||||
+ nop;
|
||||
StorageLive(_2);
|
||||
StorageLive(_3);
|
||||
StorageLive(_4);
|
||||
_9 = const _;
|
||||
@ -44,8 +43,7 @@
|
||||
+ _1 = (*_2)[1 of 2];
|
||||
StorageDead(_6);
|
||||
StorageDead(_4);
|
||||
- StorageDead(_2);
|
||||
+ nop;
|
||||
StorageDead(_2);
|
||||
_0 = const ();
|
||||
StorageDead(_1);
|
||||
return;
|
||||
|
@ -18,8 +18,7 @@
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
- StorageLive(_2);
|
||||
+ nop;
|
||||
StorageLive(_2);
|
||||
StorageLive(_3);
|
||||
StorageLive(_4);
|
||||
_9 = const _;
|
||||
@ -44,8 +43,7 @@
|
||||
+ _1 = (*_2)[1 of 2];
|
||||
StorageDead(_6);
|
||||
StorageDead(_4);
|
||||
- StorageDead(_2);
|
||||
+ nop;
|
||||
StorageDead(_2);
|
||||
_0 = const ();
|
||||
StorageDead(_1);
|
||||
return;
|
||||
|
@ -18,8 +18,7 @@
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
- StorageLive(_2);
|
||||
+ nop;
|
||||
StorageLive(_2);
|
||||
StorageLive(_3);
|
||||
StorageLive(_4);
|
||||
_9 = const _;
|
||||
@ -44,8 +43,7 @@
|
||||
+ _1 = (*_2)[1 of 2];
|
||||
StorageDead(_6);
|
||||
StorageDead(_4);
|
||||
- StorageDead(_2);
|
||||
+ nop;
|
||||
StorageDead(_2);
|
||||
_0 = const ();
|
||||
StorageDead(_1);
|
||||
return;
|
||||
|
@ -13,13 +13,12 @@
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
- StorageLive(_2);
|
||||
StorageLive(_2);
|
||||
- _2 = const 1_usize as &mut Never (Transmute);
|
||||
+ nop;
|
||||
- _1 = &mut (*_2);
|
||||
+ _2 = const {0x1 as &mut Never};
|
||||
_1 = &mut (*_2);
|
||||
- StorageDead(_2);
|
||||
+ nop;
|
||||
+ _1 = const {0x1 as &mut Never};
|
||||
StorageDead(_2);
|
||||
unreachable;
|
||||
}
|
||||
}
|
||||
|
@ -13,13 +13,12 @@
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
- StorageLive(_2);
|
||||
StorageLive(_2);
|
||||
- _2 = const 1_usize as &mut Never (Transmute);
|
||||
+ nop;
|
||||
- _1 = &mut (*_2);
|
||||
+ _2 = const {0x1 as &mut Never};
|
||||
_1 = &mut (*_2);
|
||||
- StorageDead(_2);
|
||||
+ nop;
|
||||
+ _1 = const {0x1 as &mut Never};
|
||||
StorageDead(_2);
|
||||
unreachable;
|
||||
}
|
||||
}
|
||||
|
@ -72,8 +72,7 @@
|
||||
bb2: {
|
||||
StorageDead(_7);
|
||||
StorageDead(_6);
|
||||
- StorageLive(_8);
|
||||
+ nop;
|
||||
StorageLive(_8);
|
||||
_8 = &raw const (*_1);
|
||||
StorageLive(_9);
|
||||
StorageLive(_10);
|
||||
@ -93,8 +92,7 @@
|
||||
bb4: {
|
||||
StorageDead(_12);
|
||||
StorageDead(_11);
|
||||
- StorageLive(_13);
|
||||
+ nop;
|
||||
StorageLive(_13);
|
||||
_13 = &raw mut (*_1);
|
||||
StorageLive(_14);
|
||||
StorageLive(_15);
|
||||
@ -114,8 +112,7 @@
|
||||
bb6: {
|
||||
StorageDead(_17);
|
||||
StorageDead(_16);
|
||||
- StorageLive(_18);
|
||||
+ nop;
|
||||
StorageLive(_18);
|
||||
_18 = &(*_1);
|
||||
StorageLive(_19);
|
||||
- StorageLive(_20);
|
||||
@ -191,12 +188,9 @@
|
||||
StorageDead(_32);
|
||||
StorageDead(_31);
|
||||
_0 = const ();
|
||||
- StorageDead(_18);
|
||||
- StorageDead(_13);
|
||||
- StorageDead(_8);
|
||||
+ nop;
|
||||
+ nop;
|
||||
+ nop;
|
||||
StorageDead(_18);
|
||||
StorageDead(_13);
|
||||
StorageDead(_8);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -72,8 +72,7 @@
|
||||
bb2: {
|
||||
StorageDead(_7);
|
||||
StorageDead(_6);
|
||||
- StorageLive(_8);
|
||||
+ nop;
|
||||
StorageLive(_8);
|
||||
_8 = &raw const (*_1);
|
||||
StorageLive(_9);
|
||||
StorageLive(_10);
|
||||
@ -93,8 +92,7 @@
|
||||
bb4: {
|
||||
StorageDead(_12);
|
||||
StorageDead(_11);
|
||||
- StorageLive(_13);
|
||||
+ nop;
|
||||
StorageLive(_13);
|
||||
_13 = &raw mut (*_1);
|
||||
StorageLive(_14);
|
||||
StorageLive(_15);
|
||||
@ -114,8 +112,7 @@
|
||||
bb6: {
|
||||
StorageDead(_17);
|
||||
StorageDead(_16);
|
||||
- StorageLive(_18);
|
||||
+ nop;
|
||||
StorageLive(_18);
|
||||
_18 = &(*_1);
|
||||
StorageLive(_19);
|
||||
- StorageLive(_20);
|
||||
@ -191,12 +188,9 @@
|
||||
StorageDead(_32);
|
||||
StorageDead(_31);
|
||||
_0 = const ();
|
||||
- StorageDead(_18);
|
||||
- StorageDead(_13);
|
||||
- StorageDead(_8);
|
||||
+ nop;
|
||||
+ nop;
|
||||
+ nop;
|
||||
StorageDead(_18);
|
||||
StorageDead(_13);
|
||||
StorageDead(_8);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -194,15 +194,13 @@
|
||||
- _23 = move _21;
|
||||
+ _23 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_24);
|
||||
- StorageLive(_25);
|
||||
StorageLive(_25);
|
||||
- _25 = &(*_15);
|
||||
+ nop;
|
||||
+ _25 = &(*_9);
|
||||
_24 = &(*_25);
|
||||
StorageLive(_26);
|
||||
- StorageLive(_27);
|
||||
StorageLive(_27);
|
||||
- _27 = &(*_16);
|
||||
+ nop;
|
||||
+ _27 = &(*_12);
|
||||
_26 = &(*_27);
|
||||
StorageLive(_28);
|
||||
@ -293,15 +291,13 @@
|
||||
- _49 = move _47;
|
||||
+ _49 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_50);
|
||||
- StorageLive(_51);
|
||||
StorageLive(_51);
|
||||
- _51 = &(*_41);
|
||||
+ nop;
|
||||
+ _51 = &(*_35);
|
||||
_50 = &(*_51);
|
||||
StorageLive(_52);
|
||||
- StorageLive(_53);
|
||||
StorageLive(_53);
|
||||
- _53 = &(*_42);
|
||||
+ nop;
|
||||
+ _53 = &(*_38);
|
||||
_52 = &(*_53);
|
||||
StorageLive(_54);
|
||||
|
@ -194,15 +194,13 @@
|
||||
- _23 = move _21;
|
||||
+ _23 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_24);
|
||||
- StorageLive(_25);
|
||||
StorageLive(_25);
|
||||
- _25 = &(*_15);
|
||||
+ nop;
|
||||
+ _25 = &(*_9);
|
||||
_24 = &(*_25);
|
||||
StorageLive(_26);
|
||||
- StorageLive(_27);
|
||||
StorageLive(_27);
|
||||
- _27 = &(*_16);
|
||||
+ nop;
|
||||
+ _27 = &(*_12);
|
||||
_26 = &(*_27);
|
||||
StorageLive(_28);
|
||||
@ -293,15 +291,13 @@
|
||||
- _49 = move _47;
|
||||
+ _49 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_50);
|
||||
- StorageLive(_51);
|
||||
StorageLive(_51);
|
||||
- _51 = &(*_41);
|
||||
+ nop;
|
||||
+ _51 = &(*_35);
|
||||
_50 = &(*_51);
|
||||
StorageLive(_52);
|
||||
- StorageLive(_53);
|
||||
StorageLive(_53);
|
||||
- _53 = &(*_42);
|
||||
+ nop;
|
||||
+ _53 = &(*_38);
|
||||
_52 = &(*_53);
|
||||
StorageLive(_54);
|
||||
|
@ -757,8 +757,7 @@
|
||||
bb34: {
|
||||
StorageDead(_121);
|
||||
StorageDead(_120);
|
||||
- StorageLive(_126);
|
||||
+ nop;
|
||||
StorageLive(_126);
|
||||
_126 = &_3;
|
||||
StorageLive(_127);
|
||||
- StorageLive(_128);
|
||||
@ -799,8 +798,7 @@
|
||||
bb36: {
|
||||
StorageDead(_132);
|
||||
StorageDead(_131);
|
||||
- StorageLive(_135);
|
||||
+ nop;
|
||||
StorageLive(_135);
|
||||
_135 = &mut _3;
|
||||
StorageLive(_136);
|
||||
StorageLive(_137);
|
||||
@ -835,8 +833,7 @@
|
||||
StorageDead(_141);
|
||||
StorageDead(_140);
|
||||
StorageLive(_144);
|
||||
- StorageLive(_145);
|
||||
+ nop;
|
||||
StorageLive(_145);
|
||||
_145 = &raw const _3;
|
||||
StorageLive(_146);
|
||||
StorageLive(_147);
|
||||
@ -870,8 +867,7 @@
|
||||
bb40: {
|
||||
StorageDead(_151);
|
||||
StorageDead(_150);
|
||||
- StorageLive(_154);
|
||||
+ nop;
|
||||
StorageLive(_154);
|
||||
_154 = &raw mut _3;
|
||||
StorageLive(_155);
|
||||
StorageLive(_156);
|
||||
@ -906,13 +902,10 @@
|
||||
StorageDead(_160);
|
||||
StorageDead(_159);
|
||||
_144 = const ();
|
||||
- StorageDead(_154);
|
||||
- StorageDead(_145);
|
||||
+ nop;
|
||||
+ nop;
|
||||
StorageDead(_154);
|
||||
StorageDead(_145);
|
||||
StorageDead(_144);
|
||||
- StorageLive(_163);
|
||||
+ nop;
|
||||
StorageLive(_163);
|
||||
_163 = &_3;
|
||||
StorageLive(_164);
|
||||
- StorageLive(_165);
|
||||
@ -954,12 +947,9 @@
|
||||
StorageDead(_169);
|
||||
StorageDead(_168);
|
||||
_0 = const ();
|
||||
- StorageDead(_163);
|
||||
- StorageDead(_135);
|
||||
- StorageDead(_126);
|
||||
+ nop;
|
||||
+ nop;
|
||||
+ nop;
|
||||
StorageDead(_163);
|
||||
StorageDead(_135);
|
||||
StorageDead(_126);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -757,8 +757,7 @@
|
||||
bb34: {
|
||||
StorageDead(_121);
|
||||
StorageDead(_120);
|
||||
- StorageLive(_126);
|
||||
+ nop;
|
||||
StorageLive(_126);
|
||||
_126 = &_3;
|
||||
StorageLive(_127);
|
||||
- StorageLive(_128);
|
||||
@ -799,8 +798,7 @@
|
||||
bb36: {
|
||||
StorageDead(_132);
|
||||
StorageDead(_131);
|
||||
- StorageLive(_135);
|
||||
+ nop;
|
||||
StorageLive(_135);
|
||||
_135 = &mut _3;
|
||||
StorageLive(_136);
|
||||
StorageLive(_137);
|
||||
@ -835,8 +833,7 @@
|
||||
StorageDead(_141);
|
||||
StorageDead(_140);
|
||||
StorageLive(_144);
|
||||
- StorageLive(_145);
|
||||
+ nop;
|
||||
StorageLive(_145);
|
||||
_145 = &raw const _3;
|
||||
StorageLive(_146);
|
||||
StorageLive(_147);
|
||||
@ -870,8 +867,7 @@
|
||||
bb40: {
|
||||
StorageDead(_151);
|
||||
StorageDead(_150);
|
||||
- StorageLive(_154);
|
||||
+ nop;
|
||||
StorageLive(_154);
|
||||
_154 = &raw mut _3;
|
||||
StorageLive(_155);
|
||||
StorageLive(_156);
|
||||
@ -906,13 +902,10 @@
|
||||
StorageDead(_160);
|
||||
StorageDead(_159);
|
||||
_144 = const ();
|
||||
- StorageDead(_154);
|
||||
- StorageDead(_145);
|
||||
+ nop;
|
||||
+ nop;
|
||||
StorageDead(_154);
|
||||
StorageDead(_145);
|
||||
StorageDead(_144);
|
||||
- StorageLive(_163);
|
||||
+ nop;
|
||||
StorageLive(_163);
|
||||
_163 = &_3;
|
||||
StorageLive(_164);
|
||||
- StorageLive(_165);
|
||||
@ -954,12 +947,9 @@
|
||||
StorageDead(_169);
|
||||
StorageDead(_168);
|
||||
_0 = const ();
|
||||
- StorageDead(_163);
|
||||
- StorageDead(_135);
|
||||
- StorageDead(_126);
|
||||
+ nop;
|
||||
+ nop;
|
||||
+ nop;
|
||||
StorageDead(_163);
|
||||
StorageDead(_135);
|
||||
StorageDead(_126);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -94,6 +94,8 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:8:25: 8:39}, _2
|
||||
StorageLive(_9);
|
||||
_9 = _6;
|
||||
_10 = &_9;
|
||||
StorageLive(_11);
|
||||
StorageLive(_12);
|
||||
_11 = _4;
|
||||
_12 = _9;
|
||||
StorageLive(_13);
|
||||
@ -103,6 +105,8 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:8:25: 8:39}, _2
|
||||
_15 = Le(move _13, move _14);
|
||||
StorageDead(_14);
|
||||
StorageDead(_13);
|
||||
StorageDead(_12);
|
||||
StorageDead(_11);
|
||||
switchInt(move _15) -> [0: bb1, otherwise: bb2];
|
||||
}
|
||||
|
||||
@ -124,6 +128,8 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:8:25: 8:39}, _2
|
||||
StorageLive(_17);
|
||||
_17 = _5;
|
||||
_18 = &_17;
|
||||
StorageLive(_19);
|
||||
StorageLive(_20);
|
||||
_19 = _7;
|
||||
_20 = _17;
|
||||
StorageLive(_21);
|
||||
@ -133,6 +139,8 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:8:25: 8:39}, _2
|
||||
_23 = Le(move _21, move _22);
|
||||
StorageDead(_22);
|
||||
StorageDead(_21);
|
||||
StorageDead(_20);
|
||||
StorageDead(_19);
|
||||
switchInt(move _23) -> [0: bb3, otherwise: bb8];
|
||||
}
|
||||
|
||||
@ -151,6 +159,8 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:8:25: 8:39}, _2
|
||||
StorageLive(_25);
|
||||
_25 = _4;
|
||||
_26 = &_25;
|
||||
StorageLive(_27);
|
||||
StorageLive(_28);
|
||||
_27 = _6;
|
||||
_28 = _25;
|
||||
StorageLive(_29);
|
||||
@ -160,6 +170,8 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:8:25: 8:39}, _2
|
||||
_31 = Le(move _29, move _30);
|
||||
StorageDead(_30);
|
||||
StorageDead(_29);
|
||||
StorageDead(_28);
|
||||
StorageDead(_27);
|
||||
switchInt(move _31) -> [0: bb5, otherwise: bb6];
|
||||
}
|
||||
|
||||
@ -181,6 +193,8 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:8:25: 8:39}, _2
|
||||
StorageLive(_33);
|
||||
_33 = _7;
|
||||
_34 = &_33;
|
||||
StorageLive(_35);
|
||||
StorageLive(_36);
|
||||
_35 = _5;
|
||||
_36 = _33;
|
||||
StorageLive(_37);
|
||||
@ -190,6 +204,8 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:8:25: 8:39}, _2
|
||||
_0 = Le(move _37, move _38);
|
||||
StorageDead(_38);
|
||||
StorageDead(_37);
|
||||
StorageDead(_36);
|
||||
StorageDead(_35);
|
||||
StorageDead(_33);
|
||||
StorageDead(_34);
|
||||
StorageDead(_32);
|
||||
|
@ -50,6 +50,7 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_7);
|
||||
StorageLive(_4);
|
||||
StorageLive(_3);
|
||||
_3 = Len((*_1));
|
||||
@ -85,6 +86,7 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
|
||||
|
||||
bb3: {
|
||||
StorageDead(_4);
|
||||
StorageDead(_7);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_7);
|
||||
StorageLive(_4);
|
||||
StorageLive(_3);
|
||||
_3 = Len((*_1));
|
||||
@ -85,6 +86,7 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
|
||||
|
||||
bb3: {
|
||||
StorageDead(_4);
|
||||
StorageDead(_7);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user