Evaluate computed values to constants.
This commit is contained in:
parent
afd631cc0c
commit
38c86b0798
15 changed files with 546 additions and 191 deletions
|
@ -1,7 +1,8 @@
|
|||
//! Functions for reading and writing discriminants of multi-variant layouts (enums and coroutines).
|
||||
|
||||
use rustc_middle::ty::layout::{LayoutOf, PrimitiveExt, TyAndLayout};
|
||||
use rustc_middle::{mir, ty};
|
||||
use rustc_middle::mir;
|
||||
use rustc_middle::ty::layout::{LayoutOf, PrimitiveExt};
|
||||
use rustc_middle::ty::{self, Ty};
|
||||
use rustc_target::abi::{self, TagEncoding};
|
||||
use rustc_target::abi::{VariantIdx, Variants};
|
||||
|
||||
|
@ -244,11 +245,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
|
||||
pub fn discriminant_for_variant(
|
||||
&self,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
ty: Ty<'tcx>,
|
||||
variant: VariantIdx,
|
||||
) -> InterpResult<'tcx, ImmTy<'tcx, M::Provenance>> {
|
||||
let discr_layout = self.layout_of(layout.ty.discriminant_ty(*self.tcx))?;
|
||||
let discr_value = match layout.ty.discriminant_for_variant(*self.tcx, variant) {
|
||||
let discr_layout = self.layout_of(ty.discriminant_ty(*self.tcx))?;
|
||||
let discr_value = match ty.discriminant_for_variant(*self.tcx, variant) {
|
||||
Some(discr) => {
|
||||
// This type actually has discriminants.
|
||||
assert_eq!(discr.ty, discr_layout.ty);
|
||||
|
|
|
@ -218,7 +218,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
sym::discriminant_value => {
|
||||
let place = self.deref_pointer(&args[0])?;
|
||||
let variant = self.read_discriminant(&place)?;
|
||||
let discr = self.discriminant_for_variant(place.layout, variant)?;
|
||||
let discr = self.discriminant_for_variant(place.layout.ty, variant)?;
|
||||
self.write_immediate(*discr, dest)?;
|
||||
}
|
||||
sym::exact_div => {
|
||||
|
|
|
@ -169,6 +169,16 @@ impl<'tcx, Prov: Provenance> ImmTy<'tcx, Prov> {
|
|||
ImmTy { imm: val.into(), layout }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn from_scalar_pair(a: Scalar<Prov>, b: Scalar<Prov>, layout: TyAndLayout<'tcx>) -> Self {
|
||||
debug_assert!(
|
||||
matches!(layout.abi, Abi::ScalarPair(..)),
|
||||
"`ImmTy::from_scalar_pair` on non-scalar-pair layout"
|
||||
);
|
||||
let imm = Immediate::ScalarPair(a, b);
|
||||
ImmTy { imm, layout }
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn from_immediate(imm: Immediate<Prov>, layout: TyAndLayout<'tcx>) -> Self {
|
||||
debug_assert!(
|
||||
|
|
|
@ -297,7 +297,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
Discriminant(place) => {
|
||||
let op = self.eval_place_to_op(place, None)?;
|
||||
let variant = self.read_discriminant(&op)?;
|
||||
let discr = self.discriminant_for_variant(op.layout, variant)?;
|
||||
let discr = self.discriminant_for_variant(op.layout.ty, variant)?;
|
||||
self.write_immediate(*discr, &dest)?;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,6 +172,18 @@ impl<'tcx> ConstValue<'tcx> {
|
|||
let end = end.try_into().unwrap();
|
||||
Some(data.inner().inspect_with_uninit_and_ptr_outside_interpreter(start..end))
|
||||
}
|
||||
|
||||
pub fn has_provenance(&self, tcx: TyCtxt<'tcx>, size: Size) -> bool {
|
||||
let (alloc, start, end) = match *self {
|
||||
ConstValue::ZeroSized | ConstValue::Scalar(Scalar::Int(_)) => return false,
|
||||
ConstValue::Scalar(Scalar::Ptr(..)) => return true,
|
||||
ConstValue::Slice { data, meta } => (data, Size::ZERO, Size::from_bytes(meta)),
|
||||
ConstValue::Indirect { alloc_id, offset } => {
|
||||
(tcx.global_alloc(alloc_id).unwrap_memory(), offset, offset + size)
|
||||
}
|
||||
};
|
||||
!alloc.inner().provenance().range_empty(super::AllocRange::from(start..end), &tcx)
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -406,7 +406,8 @@ impl<'a, 'tcx> ConstAnalysis<'a, 'tcx> {
|
|||
TrackElem::Variant(idx) => self.ecx.project_downcast(op, idx).ok(),
|
||||
TrackElem::Discriminant => {
|
||||
let variant = self.ecx.read_discriminant(op).ok()?;
|
||||
let discr_value = self.ecx.discriminant_for_variant(op.layout, variant).ok()?;
|
||||
let discr_value =
|
||||
self.ecx.discriminant_for_variant(op.layout.ty, variant).ok()?;
|
||||
Some(discr_value.into())
|
||||
}
|
||||
TrackElem::DerefLen => {
|
||||
|
@ -507,7 +508,8 @@ impl<'a, 'tcx> ConstAnalysis<'a, 'tcx> {
|
|||
return None;
|
||||
}
|
||||
let enum_ty_layout = self.tcx.layout_of(self.param_env.and(enum_ty)).ok()?;
|
||||
let discr_value = self.ecx.discriminant_for_variant(enum_ty_layout, variant_index).ok()?;
|
||||
let discr_value =
|
||||
self.ecx.discriminant_for_variant(enum_ty_layout.ty, variant_index).ok()?;
|
||||
Some(discr_value.to_scalar())
|
||||
}
|
||||
|
||||
|
@ -854,7 +856,7 @@ impl<'tcx> Visitor<'tcx> for OperandCollector<'tcx, '_, '_, '_> {
|
|||
}
|
||||
}
|
||||
|
||||
struct DummyMachine;
|
||||
pub(crate) struct DummyMachine;
|
||||
|
||||
impl<'mir, 'tcx: 'mir> rustc_const_eval::interpret::Machine<'mir, 'tcx> for DummyMachine {
|
||||
rustc_const_eval::interpret::compile_time_machine!(<'mir, 'tcx>);
|
||||
|
|
|
@ -53,18 +53,24 @@
|
|||
//! _c = *_b // replaced by _c = _a
|
||||
//! ```
|
||||
|
||||
use rustc_const_eval::interpret::{ImmTy, InterpCx, MemPlaceMeta, OpTy, Projectable, Scalar};
|
||||
use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
|
||||
use rustc_data_structures::graph::dominators::Dominators;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::IndexVec;
|
||||
use rustc_macros::newtype_index;
|
||||
use rustc_middle::mir::interpret::GlobalAlloc;
|
||||
use rustc_middle::mir::visit::*;
|
||||
use rustc_middle::mir::*;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_target::abi::{VariantIdx, FIRST_VARIANT};
|
||||
use rustc_middle::ty::layout::LayoutOf;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt, TypeAndMut};
|
||||
use rustc_span::DUMMY_SP;
|
||||
use rustc_target::abi::{self, Abi, Size, VariantIdx, FIRST_VARIANT};
|
||||
|
||||
use crate::dataflow_const_prop::DummyMachine;
|
||||
use crate::ssa::{AssignedValue, SsaLocals};
|
||||
use crate::MirPass;
|
||||
use either::Either;
|
||||
|
||||
pub struct GVN;
|
||||
|
||||
|
@ -129,6 +135,12 @@ newtype_index! {
|
|||
struct VnIndex {}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||||
enum AddressKind {
|
||||
Ref(BorrowKind),
|
||||
Address(Mutability),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Hash)]
|
||||
enum Value<'tcx> {
|
||||
// Root values.
|
||||
|
@ -145,6 +157,7 @@ enum Value<'tcx> {
|
|||
/// The address of a place.
|
||||
Address {
|
||||
place: Place<'tcx>,
|
||||
kind: AddressKind,
|
||||
/// Give each borrow and pointer a different provenance, so we don't merge them.
|
||||
provenance: usize,
|
||||
},
|
||||
|
@ -172,6 +185,7 @@ enum Value<'tcx> {
|
|||
|
||||
struct VnState<'body, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
ecx: InterpCx<'tcx, 'tcx, DummyMachine>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
local_decls: &'body LocalDecls<'tcx>,
|
||||
/// Value stored in each local.
|
||||
|
@ -179,6 +193,8 @@ struct VnState<'body, 'tcx> {
|
|||
/// First local to be assigned that value.
|
||||
rev_locals: FxHashMap<VnIndex, Vec<Local>>,
|
||||
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>,
|
||||
|
@ -197,11 +213,13 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||
) -> Self {
|
||||
VnState {
|
||||
tcx,
|
||||
ecx: InterpCx::new(tcx, DUMMY_SP, param_env, DummyMachine),
|
||||
param_env,
|
||||
local_decls,
|
||||
locals: IndexVec::from_elem(None, local_decls),
|
||||
rev_locals: FxHashMap::default(),
|
||||
values: FxIndexSet::default(),
|
||||
evaluated: IndexVec::new(),
|
||||
next_opaque: Some(0),
|
||||
ssa,
|
||||
dominators,
|
||||
|
@ -211,8 +229,14 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||
|
||||
#[instrument(level = "trace", skip(self), ret)]
|
||||
fn insert(&mut self, value: Value<'tcx>) -> VnIndex {
|
||||
let (index, _) = self.values.insert_full(value);
|
||||
VnIndex::from_usize(index)
|
||||
let (index, new) = self.values.insert_full(value);
|
||||
let index = VnIndex::from_usize(index);
|
||||
if new {
|
||||
let evaluated = self.eval_to_const(index);
|
||||
let _index = self.evaluated.push(evaluated);
|
||||
debug_assert_eq!(index, _index);
|
||||
}
|
||||
index
|
||||
}
|
||||
|
||||
/// Create a new `Value` for which we have no information at all, except that it is distinct
|
||||
|
@ -227,9 +251,9 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||
|
||||
/// Create a new `Value::Address` distinct from all the others.
|
||||
#[instrument(level = "trace", skip(self), ret)]
|
||||
fn new_pointer(&mut self, place: Place<'tcx>) -> Option<VnIndex> {
|
||||
fn new_pointer(&mut self, place: Place<'tcx>, kind: AddressKind) -> Option<VnIndex> {
|
||||
let next_opaque = self.next_opaque.as_mut()?;
|
||||
let value = Value::Address { place, provenance: *next_opaque };
|
||||
let value = Value::Address { place, kind, provenance: *next_opaque };
|
||||
*next_opaque += 1;
|
||||
Some(self.insert(value))
|
||||
}
|
||||
|
@ -251,6 +275,176 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[instrument(level = "trace", skip(self), ret)]
|
||||
fn eval_to_const(&mut self, value: VnIndex) -> Option<OpTy<'tcx>> {
|
||||
use Value::*;
|
||||
let op = match *self.get(value) {
|
||||
Opaque(_) => return None,
|
||||
// Do not bother evaluating repeat expressions. This would uselessly consume memory.
|
||||
Repeat(..) => return None,
|
||||
|
||||
Constant(ref constant) => self.ecx.eval_mir_constant(constant, None, None).ok()?,
|
||||
Aggregate(ty, variant, ref fields) => {
|
||||
let fields = fields
|
||||
.iter()
|
||||
.map(|&f| self.evaluated[f].as_ref())
|
||||
.collect::<Option<Vec<_>>>()?;
|
||||
let variant = if ty.is_enum() { Some(variant) } else { None };
|
||||
let ty = self.ecx.layout_of(ty).ok()?;
|
||||
let alloc_id = self
|
||||
.ecx
|
||||
.intern_with_temp_alloc(ty, |ecx, dest| {
|
||||
let variant_dest = if let Some(variant) = variant {
|
||||
ecx.project_downcast(dest, variant)?
|
||||
} else {
|
||||
dest.clone()
|
||||
};
|
||||
for (field_index, op) in fields.into_iter().enumerate() {
|
||||
let field_dest = ecx.project_field(&variant_dest, field_index)?;
|
||||
ecx.copy_op(op, &field_dest, /*allow_transmute*/ false)?;
|
||||
}
|
||||
ecx.write_discriminant(variant.unwrap_or(FIRST_VARIANT), dest)
|
||||
})
|
||||
.ok()?;
|
||||
let mplace =
|
||||
self.ecx.raw_const_to_mplace(ConstAlloc { alloc_id, ty: ty.ty }).ok()?;
|
||||
mplace.into()
|
||||
}
|
||||
|
||||
Projection(base, elem) => {
|
||||
let value = self.evaluated[base].as_ref()?;
|
||||
let elem = match elem {
|
||||
ProjectionElem::Deref => ProjectionElem::Deref,
|
||||
ProjectionElem::Downcast(name, read_variant) => {
|
||||
ProjectionElem::Downcast(name, read_variant)
|
||||
}
|
||||
ProjectionElem::Field(f, ty) => ProjectionElem::Field(f, ty),
|
||||
ProjectionElem::ConstantIndex { offset, min_length, from_end } => {
|
||||
ProjectionElem::ConstantIndex { offset, min_length, from_end }
|
||||
}
|
||||
ProjectionElem::Subslice { from, to, from_end } => {
|
||||
ProjectionElem::Subslice { from, to, from_end }
|
||||
}
|
||||
ProjectionElem::OpaqueCast(ty) => ProjectionElem::OpaqueCast(ty),
|
||||
ProjectionElem::Subtype(ty) => ProjectionElem::Subtype(ty),
|
||||
// This should have been replaced by a `ConstantIndex` earlier.
|
||||
ProjectionElem::Index(_) => return None,
|
||||
};
|
||||
self.ecx.project(value, elem).ok()?
|
||||
}
|
||||
Address { place, kind, provenance: _ } => {
|
||||
if !place.is_indirect_first_projection() {
|
||||
return None;
|
||||
}
|
||||
let local = self.locals[place.local]?;
|
||||
let pointer = self.evaluated[local].as_ref()?;
|
||||
let mut mplace = self.ecx.deref_pointer(pointer).ok()?;
|
||||
for proj in place.projection.iter().skip(1) {
|
||||
// We have no call stack to associate a local with a value, so we cannot interpret indexing.
|
||||
if matches!(proj, ProjectionElem::Index(_)) {
|
||||
return None;
|
||||
}
|
||||
mplace = self.ecx.project(&mplace, proj).ok()?;
|
||||
}
|
||||
let pointer = mplace.to_ref(&self.ecx);
|
||||
let ty = match kind {
|
||||
AddressKind::Ref(bk) => Ty::new_ref(
|
||||
self.tcx,
|
||||
self.tcx.lifetimes.re_erased,
|
||||
ty::TypeAndMut { ty: mplace.layout.ty, mutbl: bk.to_mutbl_lossy() },
|
||||
),
|
||||
AddressKind::Address(mutbl) => {
|
||||
Ty::new_ptr(self.tcx, TypeAndMut { ty: mplace.layout.ty, mutbl })
|
||||
}
|
||||
};
|
||||
let layout = self.ecx.layout_of(ty).ok()?;
|
||||
ImmTy::from_immediate(pointer, layout).into()
|
||||
}
|
||||
|
||||
Discriminant(base) => {
|
||||
let base = self.evaluated[base].as_ref()?;
|
||||
let variant = self.ecx.read_discriminant(base).ok()?;
|
||||
let discr_value =
|
||||
self.ecx.discriminant_for_variant(base.layout.ty, variant).ok()?;
|
||||
discr_value.into()
|
||||
}
|
||||
Len(slice) => {
|
||||
let slice = self.evaluated[slice].as_ref()?;
|
||||
let usize_layout = self.ecx.layout_of(self.tcx.types.usize).unwrap();
|
||||
let len = slice.len(&self.ecx).ok()?;
|
||||
let imm = ImmTy::try_from_uint(len, usize_layout)?;
|
||||
imm.into()
|
||||
}
|
||||
NullaryOp(null_op, ty) => {
|
||||
let layout = self.ecx.layout_of(ty).ok()?;
|
||||
if let NullOp::SizeOf | NullOp::AlignOf = null_op && layout.is_unsized() {
|
||||
return None;
|
||||
}
|
||||
let val = match null_op {
|
||||
NullOp::SizeOf => layout.size.bytes(),
|
||||
NullOp::AlignOf => layout.align.abi.bytes(),
|
||||
NullOp::OffsetOf(fields) => layout
|
||||
.offset_of_subfield(&self.ecx, fields.iter().map(|f| f.index()))
|
||||
.bytes(),
|
||||
};
|
||||
let usize_layout = self.ecx.layout_of(self.tcx.types.usize).unwrap();
|
||||
let imm = ImmTy::try_from_uint(val, usize_layout)?;
|
||||
imm.into()
|
||||
}
|
||||
UnaryOp(un_op, operand) => {
|
||||
let operand = self.evaluated[operand].as_ref()?;
|
||||
let operand = self.ecx.read_immediate(operand).ok()?;
|
||||
let (val, _) = self.ecx.overflowing_unary_op(un_op, &operand).ok()?;
|
||||
val.into()
|
||||
}
|
||||
BinaryOp(bin_op, lhs, rhs) => {
|
||||
let lhs = self.evaluated[lhs].as_ref()?;
|
||||
let lhs = self.ecx.read_immediate(lhs).ok()?;
|
||||
let rhs = self.evaluated[rhs].as_ref()?;
|
||||
let rhs = self.ecx.read_immediate(rhs).ok()?;
|
||||
let (val, _) = self.ecx.overflowing_binary_op(bin_op, &lhs, &rhs).ok()?;
|
||||
val.into()
|
||||
}
|
||||
CheckedBinaryOp(bin_op, lhs, rhs) => {
|
||||
let lhs = self.evaluated[lhs].as_ref()?;
|
||||
let lhs = self.ecx.read_immediate(lhs).ok()?;
|
||||
let rhs = self.evaluated[rhs].as_ref()?;
|
||||
let rhs = self.ecx.read_immediate(rhs).ok()?;
|
||||
let (val, overflowed) = self.ecx.overflowing_binary_op(bin_op, &lhs, &rhs).ok()?;
|
||||
let tuple = Ty::new_tup_from_iter(
|
||||
self.tcx,
|
||||
[val.layout.ty, self.tcx.types.bool].into_iter(),
|
||||
);
|
||||
let tuple = self.ecx.layout_of(tuple).ok()?;
|
||||
ImmTy::from_scalar_pair(val.to_scalar(), Scalar::from_bool(overflowed), tuple)
|
||||
.into()
|
||||
}
|
||||
Cast { kind, value, from: _, to } => match kind {
|
||||
CastKind::IntToInt | CastKind::IntToFloat => {
|
||||
let value = self.evaluated[value].as_ref()?;
|
||||
let value = self.ecx.read_immediate(value).ok()?;
|
||||
let to = self.ecx.layout_of(to).ok()?;
|
||||
let res = self.ecx.int_to_int_or_float(&value, to).ok()?;
|
||||
res.into()
|
||||
}
|
||||
CastKind::FloatToFloat | CastKind::FloatToInt => {
|
||||
let value = self.evaluated[value].as_ref()?;
|
||||
let value = self.ecx.read_immediate(value).ok()?;
|
||||
let to = self.ecx.layout_of(to).ok()?;
|
||||
let res = self.ecx.float_to_float_or_int(&value, to).ok()?;
|
||||
res.into()
|
||||
}
|
||||
CastKind::Transmute => {
|
||||
let value = self.evaluated[value].as_ref()?;
|
||||
let to = self.ecx.layout_of(to).ok()?;
|
||||
value.offset(Size::ZERO, to, &self.ecx).ok()?
|
||||
}
|
||||
_ => return None,
|
||||
},
|
||||
};
|
||||
Some(op)
|
||||
}
|
||||
|
||||
/// Represent the *value* which would be read from `place`, and point `place` to a preexisting
|
||||
/// place with the same value (if that already exists).
|
||||
#[instrument(level = "trace", skip(self), ret)]
|
||||
|
@ -385,7 +579,12 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||
let ty = rvalue.ty(self.local_decls, self.tcx);
|
||||
Value::Aggregate(ty, variant_index, fields?)
|
||||
}
|
||||
Rvalue::Ref(.., place) | Rvalue::AddressOf(_, place) => return self.new_pointer(place),
|
||||
Rvalue::Ref(_, borrow_kind, place) => {
|
||||
return self.new_pointer(place, AddressKind::Ref(borrow_kind));
|
||||
}
|
||||
Rvalue::AddressOf(mutbl, place) => {
|
||||
return self.new_pointer(place, AddressKind::Address(mutbl));
|
||||
}
|
||||
|
||||
// Operations.
|
||||
Rvalue::Len(ref mut place) => {
|
||||
|
@ -424,43 +623,106 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
fn op_to_prop_const<'tcx>(
|
||||
ecx: &mut InterpCx<'_, 'tcx, DummyMachine>,
|
||||
op: &OpTy<'tcx>,
|
||||
) -> Option<ConstValue<'tcx>> {
|
||||
// Do not attempt to propagate unsized locals.
|
||||
if op.layout.is_unsized() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// This constant is a ZST, just return an empty value.
|
||||
if op.layout.is_zst() {
|
||||
return Some(ConstValue::ZeroSized);
|
||||
}
|
||||
|
||||
// Do not synthetize too large constants. Codegen will just memcpy them, which we'd like to avoid.
|
||||
if !matches!(op.layout.abi, Abi::Scalar(..) | Abi::ScalarPair(..)) {
|
||||
return None;
|
||||
}
|
||||
|
||||
// If this constant has scalar ABI, return it as a `ConstValue::Scalar`.
|
||||
if let Abi::Scalar(abi::Scalar::Initialized { .. }) = op.layout.abi
|
||||
&& let Ok(scalar) = ecx.read_scalar(op)
|
||||
{
|
||||
return Some(ConstValue::Scalar(scalar));
|
||||
}
|
||||
|
||||
// If this constant is a projection of another, we can return it directly.
|
||||
if let Either::Left(mplace) = op.as_mplace_or_imm()
|
||||
&& let MemPlaceMeta::None = mplace.meta()
|
||||
{
|
||||
let pointer = mplace.ptr().into_pointer_or_addr().ok()?;
|
||||
let (alloc_id, offset) = pointer.into_parts();
|
||||
return if matches!(ecx.tcx.global_alloc(alloc_id), GlobalAlloc::Memory(_)) {
|
||||
Some(ConstValue::Indirect { alloc_id, offset })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
// Everything failed: create a new allocation to hold the data.
|
||||
let alloc_id =
|
||||
ecx.intern_with_temp_alloc(op.layout, |ecx, dest| ecx.copy_op(op, dest, false)).ok()?;
|
||||
Some(ConstValue::Indirect { alloc_id, offset: Size::ZERO })
|
||||
}
|
||||
|
||||
impl<'tcx> VnState<'_, 'tcx> {
|
||||
/// If `index` is a `Value::Constant`, return the `Constant` to be put in the MIR.
|
||||
fn try_as_constant(&mut self, index: VnIndex) -> Option<ConstOperand<'tcx>> {
|
||||
// This was already constant in MIR, do not change it.
|
||||
if let Value::Constant(const_) = *self.get(index) {
|
||||
// Some constants may contain pointers. We need to preserve the provenance of these
|
||||
// pointers, but not all constants guarantee this:
|
||||
// - valtrees purposefully do not;
|
||||
// - ConstValue::Slice does not either.
|
||||
match const_ {
|
||||
let const_ok = match const_ {
|
||||
Const::Ty(c) => match c.kind() {
|
||||
ty::ConstKind::Value(valtree) => match valtree {
|
||||
// This is just an integer, keep it.
|
||||
ty::ValTree::Leaf(_) => {}
|
||||
ty::ValTree::Branch(_) => return None,
|
||||
ty::ValTree::Leaf(_) => true,
|
||||
ty::ValTree::Branch(_) => false,
|
||||
},
|
||||
ty::ConstKind::Param(..)
|
||||
| ty::ConstKind::Unevaluated(..)
|
||||
| ty::ConstKind::Expr(..) => {}
|
||||
| ty::ConstKind::Expr(..) => true,
|
||||
// Should not appear in runtime MIR.
|
||||
ty::ConstKind::Infer(..)
|
||||
| ty::ConstKind::Bound(..)
|
||||
| ty::ConstKind::Placeholder(..)
|
||||
| ty::ConstKind::Error(..) => bug!(),
|
||||
},
|
||||
Const::Unevaluated(..) => {}
|
||||
Const::Unevaluated(..) => true,
|
||||
// If the same slice appears twice in the MIR, we cannot guarantee that we will
|
||||
// give the same `AllocId` to the data.
|
||||
Const::Val(ConstValue::Slice { .. }, _) => return None,
|
||||
Const::Val(ConstValue::Slice { .. }, _) => false,
|
||||
Const::Val(
|
||||
ConstValue::ZeroSized | ConstValue::Scalar(_) | ConstValue::Indirect { .. },
|
||||
_,
|
||||
) => {}
|
||||
) => true,
|
||||
};
|
||||
if const_ok {
|
||||
return Some(ConstOperand { span: rustc_span::DUMMY_SP, user_ty: None, const_ });
|
||||
}
|
||||
Some(ConstOperand { span: rustc_span::DUMMY_SP, user_ty: None, const_ })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
let op = self.evaluated[index].as_ref()?;
|
||||
if op.layout.is_unsized() {
|
||||
// Do not attempt to propagate unsized locals.
|
||||
return None;
|
||||
}
|
||||
|
||||
let value = op_to_prop_const(&mut self.ecx, op)?;
|
||||
|
||||
// Check that we do not leak a pointer.
|
||||
// Those pointers may lose part of their identity in codegen.
|
||||
if value.has_provenance(self.tcx, op.layout.size) {
|
||||
return None;
|
||||
}
|
||||
|
||||
let const_ = Const::Val(value, op.layout.ty);
|
||||
Some(ConstOperand { span: rustc_span::DUMMY_SP, user_ty: None, const_ })
|
||||
}
|
||||
|
||||
/// If there is a local which is assigned `index`, and its assignment strictly dominates `loc`,
|
||||
|
|
|
@ -121,9 +121,10 @@
|
|||
StorageLive(_15);
|
||||
StorageLive(_16);
|
||||
_16 = _1;
|
||||
_17 = Eq(const 0_u64, const 0_u64);
|
||||
- _17 = Eq(const 0_u64, const 0_u64);
|
||||
- assert(!move _17, "attempt to divide `{}` by zero", _16) -> [success: bb5, unwind unreachable];
|
||||
+ assert(!_17, "attempt to divide `{}` by zero", _1) -> [success: bb5, unwind unreachable];
|
||||
+ _17 = const true;
|
||||
+ assert(!const true, "attempt to divide `{}` by zero", _1) -> [success: bb5, unwind unreachable];
|
||||
}
|
||||
|
||||
bb5: {
|
||||
|
@ -140,9 +141,10 @@
|
|||
StorageLive(_19);
|
||||
StorageLive(_20);
|
||||
_20 = _1;
|
||||
_21 = Eq(const 1_u64, const 0_u64);
|
||||
- _21 = Eq(const 1_u64, const 0_u64);
|
||||
- assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb7, unwind unreachable];
|
||||
+ assert(!_21, "attempt to divide `{}` by zero", _1) -> [success: bb7, unwind unreachable];
|
||||
+ _21 = const false;
|
||||
+ assert(!const false, "attempt to divide `{}` by zero", _1) -> [success: bb7, unwind unreachable];
|
||||
}
|
||||
|
||||
bb7: {
|
||||
|
@ -201,8 +203,8 @@
|
|||
_32 = _1;
|
||||
- _33 = Eq(const 0_u64, const 0_u64);
|
||||
- assert(!move _33, "attempt to calculate the remainder of `{}` with a divisor of zero", _32) -> [success: bb13, unwind unreachable];
|
||||
+ _33 = _17;
|
||||
+ assert(!_17, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb13, unwind unreachable];
|
||||
+ _33 = const true;
|
||||
+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb13, unwind unreachable];
|
||||
}
|
||||
|
||||
bb13: {
|
||||
|
@ -221,8 +223,8 @@
|
|||
_36 = _1;
|
||||
- _37 = Eq(const 1_u64, const 0_u64);
|
||||
- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb15, unwind unreachable];
|
||||
+ _37 = _21;
|
||||
+ assert(!_21, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb15, unwind unreachable];
|
||||
+ _37 = const false;
|
||||
+ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb15, unwind unreachable];
|
||||
}
|
||||
|
||||
bb15: {
|
||||
|
|
|
@ -121,9 +121,10 @@
|
|||
StorageLive(_15);
|
||||
StorageLive(_16);
|
||||
_16 = _1;
|
||||
_17 = Eq(const 0_u64, const 0_u64);
|
||||
- _17 = Eq(const 0_u64, const 0_u64);
|
||||
- assert(!move _17, "attempt to divide `{}` by zero", _16) -> [success: bb5, unwind continue];
|
||||
+ assert(!_17, "attempt to divide `{}` by zero", _1) -> [success: bb5, unwind continue];
|
||||
+ _17 = const true;
|
||||
+ assert(!const true, "attempt to divide `{}` by zero", _1) -> [success: bb5, unwind continue];
|
||||
}
|
||||
|
||||
bb5: {
|
||||
|
@ -140,9 +141,10 @@
|
|||
StorageLive(_19);
|
||||
StorageLive(_20);
|
||||
_20 = _1;
|
||||
_21 = Eq(const 1_u64, const 0_u64);
|
||||
- _21 = Eq(const 1_u64, const 0_u64);
|
||||
- assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb7, unwind continue];
|
||||
+ assert(!_21, "attempt to divide `{}` by zero", _1) -> [success: bb7, unwind continue];
|
||||
+ _21 = const false;
|
||||
+ assert(!const false, "attempt to divide `{}` by zero", _1) -> [success: bb7, unwind continue];
|
||||
}
|
||||
|
||||
bb7: {
|
||||
|
@ -201,8 +203,8 @@
|
|||
_32 = _1;
|
||||
- _33 = Eq(const 0_u64, const 0_u64);
|
||||
- assert(!move _33, "attempt to calculate the remainder of `{}` with a divisor of zero", _32) -> [success: bb13, unwind continue];
|
||||
+ _33 = _17;
|
||||
+ assert(!_17, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb13, unwind continue];
|
||||
+ _33 = const true;
|
||||
+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb13, unwind continue];
|
||||
}
|
||||
|
||||
bb13: {
|
||||
|
@ -221,8 +223,8 @@
|
|||
_36 = _1;
|
||||
- _37 = Eq(const 1_u64, const 0_u64);
|
||||
- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb15, unwind continue];
|
||||
+ _37 = _21;
|
||||
+ assert(!_21, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb15, unwind continue];
|
||||
+ _37 = const false;
|
||||
+ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb15, unwind continue];
|
||||
}
|
||||
|
||||
bb15: {
|
||||
|
|
|
@ -153,9 +153,10 @@
|
|||
StorageLive(_19);
|
||||
StorageLive(_20);
|
||||
_20 = _1;
|
||||
_21 = Eq(const 0_u64, const 0_u64);
|
||||
- _21 = Eq(const 0_u64, const 0_u64);
|
||||
- assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb9, unwind unreachable];
|
||||
+ assert(!_21, "attempt to divide `{}` by zero", _1) -> [success: bb9, unwind unreachable];
|
||||
+ _21 = const true;
|
||||
+ assert(!const true, "attempt to divide `{}` by zero", _1) -> [success: bb9, unwind unreachable];
|
||||
}
|
||||
|
||||
bb9: {
|
||||
|
@ -172,9 +173,10 @@
|
|||
StorageLive(_23);
|
||||
StorageLive(_24);
|
||||
_24 = _1;
|
||||
_25 = Eq(const 1_u64, const 0_u64);
|
||||
- _25 = Eq(const 1_u64, const 0_u64);
|
||||
- assert(!move _25, "attempt to divide `{}` by zero", _24) -> [success: bb11, unwind unreachable];
|
||||
+ assert(!_25, "attempt to divide `{}` by zero", _1) -> [success: bb11, unwind unreachable];
|
||||
+ _25 = const false;
|
||||
+ assert(!const false, "attempt to divide `{}` by zero", _1) -> [success: bb11, unwind unreachable];
|
||||
}
|
||||
|
||||
bb11: {
|
||||
|
@ -233,8 +235,8 @@
|
|||
_36 = _1;
|
||||
- _37 = Eq(const 0_u64, const 0_u64);
|
||||
- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb17, unwind unreachable];
|
||||
+ _37 = _21;
|
||||
+ assert(!_21, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb17, unwind unreachable];
|
||||
+ _37 = const true;
|
||||
+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb17, unwind unreachable];
|
||||
}
|
||||
|
||||
bb17: {
|
||||
|
@ -253,8 +255,8 @@
|
|||
_40 = _1;
|
||||
- _41 = Eq(const 1_u64, const 0_u64);
|
||||
- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", _40) -> [success: bb19, unwind unreachable];
|
||||
+ _41 = _25;
|
||||
+ assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb19, unwind unreachable];
|
||||
+ _41 = const false;
|
||||
+ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb19, unwind unreachable];
|
||||
}
|
||||
|
||||
bb19: {
|
||||
|
@ -350,11 +352,12 @@
|
|||
StorageLive(_60);
|
||||
StorageLive(_61);
|
||||
_61 = _1;
|
||||
_62 = const 0_i32 as u32 (IntToInt);
|
||||
- _62 = const 0_i32 as u32 (IntToInt);
|
||||
- _63 = Lt(move _62, const 64_u32);
|
||||
- assert(move _63, "attempt to shift right by `{}`, which would overflow", const 0_i32) -> [success: bb28, unwind unreachable];
|
||||
+ _63 = Lt(_62, const 64_u32);
|
||||
+ assert(_63, "attempt to shift right by `{}`, which would overflow", const 0_i32) -> [success: bb28, unwind unreachable];
|
||||
+ _62 = const 0_u32;
|
||||
+ _63 = const true;
|
||||
+ assert(const true, "attempt to shift right by `{}`, which would overflow", const 0_i32) -> [success: bb28, unwind unreachable];
|
||||
}
|
||||
|
||||
bb28: {
|
||||
|
@ -374,9 +377,9 @@
|
|||
- _67 = const 0_i32 as u32 (IntToInt);
|
||||
- _68 = Lt(move _67, const 64_u32);
|
||||
- assert(move _68, "attempt to shift left by `{}`, which would overflow", const 0_i32) -> [success: bb30, unwind unreachable];
|
||||
+ _67 = _62;
|
||||
+ _68 = _63;
|
||||
+ assert(_63, "attempt to shift left by `{}`, which would overflow", const 0_i32) -> [success: bb30, unwind unreachable];
|
||||
+ _67 = const 0_u32;
|
||||
+ _68 = const true;
|
||||
+ assert(const true, "attempt to shift left by `{}`, which would overflow", const 0_i32) -> [success: bb30, unwind unreachable];
|
||||
}
|
||||
|
||||
bb30: {
|
||||
|
|
|
@ -153,9 +153,10 @@
|
|||
StorageLive(_19);
|
||||
StorageLive(_20);
|
||||
_20 = _1;
|
||||
_21 = Eq(const 0_u64, const 0_u64);
|
||||
- _21 = Eq(const 0_u64, const 0_u64);
|
||||
- assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb9, unwind continue];
|
||||
+ assert(!_21, "attempt to divide `{}` by zero", _1) -> [success: bb9, unwind continue];
|
||||
+ _21 = const true;
|
||||
+ assert(!const true, "attempt to divide `{}` by zero", _1) -> [success: bb9, unwind continue];
|
||||
}
|
||||
|
||||
bb9: {
|
||||
|
@ -172,9 +173,10 @@
|
|||
StorageLive(_23);
|
||||
StorageLive(_24);
|
||||
_24 = _1;
|
||||
_25 = Eq(const 1_u64, const 0_u64);
|
||||
- _25 = Eq(const 1_u64, const 0_u64);
|
||||
- assert(!move _25, "attempt to divide `{}` by zero", _24) -> [success: bb11, unwind continue];
|
||||
+ assert(!_25, "attempt to divide `{}` by zero", _1) -> [success: bb11, unwind continue];
|
||||
+ _25 = const false;
|
||||
+ assert(!const false, "attempt to divide `{}` by zero", _1) -> [success: bb11, unwind continue];
|
||||
}
|
||||
|
||||
bb11: {
|
||||
|
@ -233,8 +235,8 @@
|
|||
_36 = _1;
|
||||
- _37 = Eq(const 0_u64, const 0_u64);
|
||||
- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb17, unwind continue];
|
||||
+ _37 = _21;
|
||||
+ assert(!_21, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb17, unwind continue];
|
||||
+ _37 = const true;
|
||||
+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb17, unwind continue];
|
||||
}
|
||||
|
||||
bb17: {
|
||||
|
@ -253,8 +255,8 @@
|
|||
_40 = _1;
|
||||
- _41 = Eq(const 1_u64, const 0_u64);
|
||||
- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", _40) -> [success: bb19, unwind continue];
|
||||
+ _41 = _25;
|
||||
+ assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb19, unwind continue];
|
||||
+ _41 = const false;
|
||||
+ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb19, unwind continue];
|
||||
}
|
||||
|
||||
bb19: {
|
||||
|
@ -350,11 +352,12 @@
|
|||
StorageLive(_60);
|
||||
StorageLive(_61);
|
||||
_61 = _1;
|
||||
_62 = const 0_i32 as u32 (IntToInt);
|
||||
- _62 = const 0_i32 as u32 (IntToInt);
|
||||
- _63 = Lt(move _62, const 64_u32);
|
||||
- assert(move _63, "attempt to shift right by `{}`, which would overflow", const 0_i32) -> [success: bb28, unwind continue];
|
||||
+ _63 = Lt(_62, const 64_u32);
|
||||
+ assert(_63, "attempt to shift right by `{}`, which would overflow", const 0_i32) -> [success: bb28, unwind continue];
|
||||
+ _62 = const 0_u32;
|
||||
+ _63 = const true;
|
||||
+ assert(const true, "attempt to shift right by `{}`, which would overflow", const 0_i32) -> [success: bb28, unwind continue];
|
||||
}
|
||||
|
||||
bb28: {
|
||||
|
@ -374,9 +377,9 @@
|
|||
- _67 = const 0_i32 as u32 (IntToInt);
|
||||
- _68 = Lt(move _67, const 64_u32);
|
||||
- assert(move _68, "attempt to shift left by `{}`, which would overflow", const 0_i32) -> [success: bb30, unwind continue];
|
||||
+ _67 = _62;
|
||||
+ _68 = _63;
|
||||
+ assert(_63, "attempt to shift left by `{}`, which would overflow", const 0_i32) -> [success: bb30, unwind continue];
|
||||
+ _67 = const 0_u32;
|
||||
+ _68 = const true;
|
||||
+ assert(const true, "attempt to shift left by `{}`, which would overflow", const 0_i32) -> [success: bb30, unwind continue];
|
||||
}
|
||||
|
||||
bb30: {
|
||||
|
|
|
@ -119,9 +119,10 @@
|
|||
- _6 = _1;
|
||||
- _5 = move _6 as u8 (IntToInt);
|
||||
+ _6 = const 1_i64;
|
||||
+ _5 = const 1_i64 as u8 (IntToInt);
|
||||
+ _5 = const 1_u8;
|
||||
StorageDead(_6);
|
||||
_4 = opaque::<u8>(move _5) -> [return: bb1, unwind unreachable];
|
||||
- _4 = opaque::<u8>(move _5) -> [return: bb1, unwind unreachable];
|
||||
+ _4 = opaque::<u8>(const 1_u8) -> [return: bb1, unwind unreachable];
|
||||
}
|
||||
|
||||
bb1: {
|
||||
|
@ -133,9 +134,10 @@
|
|||
- _9 = _1;
|
||||
- _8 = move _9 as u16 (IntToInt);
|
||||
+ _9 = const 1_i64;
|
||||
+ _8 = const 1_i64 as u16 (IntToInt);
|
||||
+ _8 = const 1_u16;
|
||||
StorageDead(_9);
|
||||
_7 = opaque::<u16>(move _8) -> [return: bb2, unwind unreachable];
|
||||
- _7 = opaque::<u16>(move _8) -> [return: bb2, unwind unreachable];
|
||||
+ _7 = opaque::<u16>(const 1_u16) -> [return: bb2, unwind unreachable];
|
||||
}
|
||||
|
||||
bb2: {
|
||||
|
@ -147,9 +149,10 @@
|
|||
- _12 = _1;
|
||||
- _11 = move _12 as u32 (IntToInt);
|
||||
+ _12 = const 1_i64;
|
||||
+ _11 = const 1_i64 as u32 (IntToInt);
|
||||
+ _11 = const 1_u32;
|
||||
StorageDead(_12);
|
||||
_10 = opaque::<u32>(move _11) -> [return: bb3, unwind unreachable];
|
||||
- _10 = opaque::<u32>(move _11) -> [return: bb3, unwind unreachable];
|
||||
+ _10 = opaque::<u32>(const 1_u32) -> [return: bb3, unwind unreachable];
|
||||
}
|
||||
|
||||
bb3: {
|
||||
|
@ -161,9 +164,10 @@
|
|||
- _15 = _1;
|
||||
- _14 = move _15 as u64 (IntToInt);
|
||||
+ _15 = const 1_i64;
|
||||
+ _14 = const 1_i64 as u64 (IntToInt);
|
||||
+ _14 = const 1_u64;
|
||||
StorageDead(_15);
|
||||
_13 = opaque::<u64>(move _14) -> [return: bb4, unwind unreachable];
|
||||
- _13 = opaque::<u64>(move _14) -> [return: bb4, unwind unreachable];
|
||||
+ _13 = opaque::<u64>(const 1_u64) -> [return: bb4, unwind unreachable];
|
||||
}
|
||||
|
||||
bb4: {
|
||||
|
@ -175,9 +179,10 @@
|
|||
- _18 = _1;
|
||||
- _17 = move _18 as i8 (IntToInt);
|
||||
+ _18 = const 1_i64;
|
||||
+ _17 = const 1_i64 as i8 (IntToInt);
|
||||
+ _17 = const 1_i8;
|
||||
StorageDead(_18);
|
||||
_16 = opaque::<i8>(move _17) -> [return: bb5, unwind unreachable];
|
||||
- _16 = opaque::<i8>(move _17) -> [return: bb5, unwind unreachable];
|
||||
+ _16 = opaque::<i8>(const 1_i8) -> [return: bb5, unwind unreachable];
|
||||
}
|
||||
|
||||
bb5: {
|
||||
|
@ -189,9 +194,10 @@
|
|||
- _21 = _1;
|
||||
- _20 = move _21 as i16 (IntToInt);
|
||||
+ _21 = const 1_i64;
|
||||
+ _20 = const 1_i64 as i16 (IntToInt);
|
||||
+ _20 = const 1_i16;
|
||||
StorageDead(_21);
|
||||
_19 = opaque::<i16>(move _20) -> [return: bb6, unwind unreachable];
|
||||
- _19 = opaque::<i16>(move _20) -> [return: bb6, unwind unreachable];
|
||||
+ _19 = opaque::<i16>(const 1_i16) -> [return: bb6, unwind unreachable];
|
||||
}
|
||||
|
||||
bb6: {
|
||||
|
@ -203,9 +209,10 @@
|
|||
- _24 = _1;
|
||||
- _23 = move _24 as i32 (IntToInt);
|
||||
+ _24 = const 1_i64;
|
||||
+ _23 = const 1_i64 as i32 (IntToInt);
|
||||
+ _23 = const 1_i32;
|
||||
StorageDead(_24);
|
||||
_22 = opaque::<i32>(move _23) -> [return: bb7, unwind unreachable];
|
||||
- _22 = opaque::<i32>(move _23) -> [return: bb7, unwind unreachable];
|
||||
+ _22 = opaque::<i32>(const 1_i32) -> [return: bb7, unwind unreachable];
|
||||
}
|
||||
|
||||
bb7: {
|
||||
|
@ -228,9 +235,10 @@
|
|||
- _29 = _1;
|
||||
- _28 = move _29 as f32 (IntToFloat);
|
||||
+ _29 = const 1_i64;
|
||||
+ _28 = const 1_i64 as f32 (IntToFloat);
|
||||
+ _28 = const 1f32;
|
||||
StorageDead(_29);
|
||||
_27 = opaque::<f32>(move _28) -> [return: bb9, unwind unreachable];
|
||||
- _27 = opaque::<f32>(move _28) -> [return: bb9, unwind unreachable];
|
||||
+ _27 = opaque::<f32>(const 1f32) -> [return: bb9, unwind unreachable];
|
||||
}
|
||||
|
||||
bb9: {
|
||||
|
@ -242,9 +250,10 @@
|
|||
- _32 = _1;
|
||||
- _31 = move _32 as f64 (IntToFloat);
|
||||
+ _32 = const 1_i64;
|
||||
+ _31 = const 1_i64 as f64 (IntToFloat);
|
||||
+ _31 = const 1f64;
|
||||
StorageDead(_32);
|
||||
_30 = opaque::<f64>(move _31) -> [return: bb10, unwind unreachable];
|
||||
- _30 = opaque::<f64>(move _31) -> [return: bb10, unwind unreachable];
|
||||
+ _30 = opaque::<f64>(const 1f64) -> [return: bb10, unwind unreachable];
|
||||
}
|
||||
|
||||
bb10: {
|
||||
|
@ -256,9 +265,10 @@
|
|||
- _35 = _2;
|
||||
- _34 = move _35 as u8 (IntToInt);
|
||||
+ _35 = const 1_u64;
|
||||
+ _34 = const 1_u64 as u8 (IntToInt);
|
||||
+ _34 = const 1_u8;
|
||||
StorageDead(_35);
|
||||
_33 = opaque::<u8>(move _34) -> [return: bb11, unwind unreachable];
|
||||
- _33 = opaque::<u8>(move _34) -> [return: bb11, unwind unreachable];
|
||||
+ _33 = opaque::<u8>(const 1_u8) -> [return: bb11, unwind unreachable];
|
||||
}
|
||||
|
||||
bb11: {
|
||||
|
@ -270,9 +280,10 @@
|
|||
- _38 = _2;
|
||||
- _37 = move _38 as u16 (IntToInt);
|
||||
+ _38 = const 1_u64;
|
||||
+ _37 = const 1_u64 as u16 (IntToInt);
|
||||
+ _37 = const 1_u16;
|
||||
StorageDead(_38);
|
||||
_36 = opaque::<u16>(move _37) -> [return: bb12, unwind unreachable];
|
||||
- _36 = opaque::<u16>(move _37) -> [return: bb12, unwind unreachable];
|
||||
+ _36 = opaque::<u16>(const 1_u16) -> [return: bb12, unwind unreachable];
|
||||
}
|
||||
|
||||
bb12: {
|
||||
|
@ -284,9 +295,10 @@
|
|||
- _41 = _2;
|
||||
- _40 = move _41 as u32 (IntToInt);
|
||||
+ _41 = const 1_u64;
|
||||
+ _40 = const 1_u64 as u32 (IntToInt);
|
||||
+ _40 = const 1_u32;
|
||||
StorageDead(_41);
|
||||
_39 = opaque::<u32>(move _40) -> [return: bb13, unwind unreachable];
|
||||
- _39 = opaque::<u32>(move _40) -> [return: bb13, unwind unreachable];
|
||||
+ _39 = opaque::<u32>(const 1_u32) -> [return: bb13, unwind unreachable];
|
||||
}
|
||||
|
||||
bb13: {
|
||||
|
@ -309,9 +321,10 @@
|
|||
- _46 = _2;
|
||||
- _45 = move _46 as i8 (IntToInt);
|
||||
+ _46 = const 1_u64;
|
||||
+ _45 = const 1_u64 as i8 (IntToInt);
|
||||
+ _45 = const 1_i8;
|
||||
StorageDead(_46);
|
||||
_44 = opaque::<i8>(move _45) -> [return: bb15, unwind unreachable];
|
||||
- _44 = opaque::<i8>(move _45) -> [return: bb15, unwind unreachable];
|
||||
+ _44 = opaque::<i8>(const 1_i8) -> [return: bb15, unwind unreachable];
|
||||
}
|
||||
|
||||
bb15: {
|
||||
|
@ -323,9 +336,10 @@
|
|||
- _49 = _2;
|
||||
- _48 = move _49 as i16 (IntToInt);
|
||||
+ _49 = const 1_u64;
|
||||
+ _48 = const 1_u64 as i16 (IntToInt);
|
||||
+ _48 = const 1_i16;
|
||||
StorageDead(_49);
|
||||
_47 = opaque::<i16>(move _48) -> [return: bb16, unwind unreachable];
|
||||
- _47 = opaque::<i16>(move _48) -> [return: bb16, unwind unreachable];
|
||||
+ _47 = opaque::<i16>(const 1_i16) -> [return: bb16, unwind unreachable];
|
||||
}
|
||||
|
||||
bb16: {
|
||||
|
@ -337,9 +351,10 @@
|
|||
- _52 = _2;
|
||||
- _51 = move _52 as i32 (IntToInt);
|
||||
+ _52 = const 1_u64;
|
||||
+ _51 = const 1_u64 as i32 (IntToInt);
|
||||
+ _51 = const 1_i32;
|
||||
StorageDead(_52);
|
||||
_50 = opaque::<i32>(move _51) -> [return: bb17, unwind unreachable];
|
||||
- _50 = opaque::<i32>(move _51) -> [return: bb17, unwind unreachable];
|
||||
+ _50 = opaque::<i32>(const 1_i32) -> [return: bb17, unwind unreachable];
|
||||
}
|
||||
|
||||
bb17: {
|
||||
|
@ -351,9 +366,10 @@
|
|||
- _55 = _2;
|
||||
- _54 = move _55 as i64 (IntToInt);
|
||||
+ _55 = const 1_u64;
|
||||
+ _54 = const 1_u64 as i64 (IntToInt);
|
||||
+ _54 = const 1_i64;
|
||||
StorageDead(_55);
|
||||
_53 = opaque::<i64>(move _54) -> [return: bb18, unwind unreachable];
|
||||
- _53 = opaque::<i64>(move _54) -> [return: bb18, unwind unreachable];
|
||||
+ _53 = opaque::<i64>(const 1_i64) -> [return: bb18, unwind unreachable];
|
||||
}
|
||||
|
||||
bb18: {
|
||||
|
@ -365,9 +381,10 @@
|
|||
- _58 = _2;
|
||||
- _57 = move _58 as f32 (IntToFloat);
|
||||
+ _58 = const 1_u64;
|
||||
+ _57 = const 1_u64 as f32 (IntToFloat);
|
||||
+ _57 = const 1f32;
|
||||
StorageDead(_58);
|
||||
_56 = opaque::<f32>(move _57) -> [return: bb19, unwind unreachable];
|
||||
- _56 = opaque::<f32>(move _57) -> [return: bb19, unwind unreachable];
|
||||
+ _56 = opaque::<f32>(const 1f32) -> [return: bb19, unwind unreachable];
|
||||
}
|
||||
|
||||
bb19: {
|
||||
|
@ -379,9 +396,10 @@
|
|||
- _61 = _2;
|
||||
- _60 = move _61 as f64 (IntToFloat);
|
||||
+ _61 = const 1_u64;
|
||||
+ _60 = const 1_u64 as f64 (IntToFloat);
|
||||
+ _60 = const 1f64;
|
||||
StorageDead(_61);
|
||||
_59 = opaque::<f64>(move _60) -> [return: bb20, unwind unreachable];
|
||||
- _59 = opaque::<f64>(move _60) -> [return: bb20, unwind unreachable];
|
||||
+ _59 = opaque::<f64>(const 1f64) -> [return: bb20, unwind unreachable];
|
||||
}
|
||||
|
||||
bb20: {
|
||||
|
@ -393,9 +411,10 @@
|
|||
- _64 = _3;
|
||||
- _63 = move _64 as u8 (FloatToInt);
|
||||
+ _64 = const 1f64;
|
||||
+ _63 = const 1f64 as u8 (FloatToInt);
|
||||
+ _63 = const 1_u8;
|
||||
StorageDead(_64);
|
||||
_62 = opaque::<u8>(move _63) -> [return: bb21, unwind unreachable];
|
||||
- _62 = opaque::<u8>(move _63) -> [return: bb21, unwind unreachable];
|
||||
+ _62 = opaque::<u8>(const 1_u8) -> [return: bb21, unwind unreachable];
|
||||
}
|
||||
|
||||
bb21: {
|
||||
|
@ -407,9 +426,10 @@
|
|||
- _67 = _3;
|
||||
- _66 = move _67 as u16 (FloatToInt);
|
||||
+ _67 = const 1f64;
|
||||
+ _66 = const 1f64 as u16 (FloatToInt);
|
||||
+ _66 = const 1_u16;
|
||||
StorageDead(_67);
|
||||
_65 = opaque::<u16>(move _66) -> [return: bb22, unwind unreachable];
|
||||
- _65 = opaque::<u16>(move _66) -> [return: bb22, unwind unreachable];
|
||||
+ _65 = opaque::<u16>(const 1_u16) -> [return: bb22, unwind unreachable];
|
||||
}
|
||||
|
||||
bb22: {
|
||||
|
@ -421,9 +441,10 @@
|
|||
- _70 = _3;
|
||||
- _69 = move _70 as u32 (FloatToInt);
|
||||
+ _70 = const 1f64;
|
||||
+ _69 = const 1f64 as u32 (FloatToInt);
|
||||
+ _69 = const 1_u32;
|
||||
StorageDead(_70);
|
||||
_68 = opaque::<u32>(move _69) -> [return: bb23, unwind unreachable];
|
||||
- _68 = opaque::<u32>(move _69) -> [return: bb23, unwind unreachable];
|
||||
+ _68 = opaque::<u32>(const 1_u32) -> [return: bb23, unwind unreachable];
|
||||
}
|
||||
|
||||
bb23: {
|
||||
|
@ -435,9 +456,10 @@
|
|||
- _73 = _3;
|
||||
- _72 = move _73 as u64 (FloatToInt);
|
||||
+ _73 = const 1f64;
|
||||
+ _72 = const 1f64 as u64 (FloatToInt);
|
||||
+ _72 = const 1_u64;
|
||||
StorageDead(_73);
|
||||
_71 = opaque::<u64>(move _72) -> [return: bb24, unwind unreachable];
|
||||
- _71 = opaque::<u64>(move _72) -> [return: bb24, unwind unreachable];
|
||||
+ _71 = opaque::<u64>(const 1_u64) -> [return: bb24, unwind unreachable];
|
||||
}
|
||||
|
||||
bb24: {
|
||||
|
@ -449,9 +471,10 @@
|
|||
- _76 = _3;
|
||||
- _75 = move _76 as i8 (FloatToInt);
|
||||
+ _76 = const 1f64;
|
||||
+ _75 = const 1f64 as i8 (FloatToInt);
|
||||
+ _75 = const 1_i8;
|
||||
StorageDead(_76);
|
||||
_74 = opaque::<i8>(move _75) -> [return: bb25, unwind unreachable];
|
||||
- _74 = opaque::<i8>(move _75) -> [return: bb25, unwind unreachable];
|
||||
+ _74 = opaque::<i8>(const 1_i8) -> [return: bb25, unwind unreachable];
|
||||
}
|
||||
|
||||
bb25: {
|
||||
|
@ -463,9 +486,10 @@
|
|||
- _79 = _3;
|
||||
- _78 = move _79 as i16 (FloatToInt);
|
||||
+ _79 = const 1f64;
|
||||
+ _78 = const 1f64 as i16 (FloatToInt);
|
||||
+ _78 = const 1_i16;
|
||||
StorageDead(_79);
|
||||
_77 = opaque::<i16>(move _78) -> [return: bb26, unwind unreachable];
|
||||
- _77 = opaque::<i16>(move _78) -> [return: bb26, unwind unreachable];
|
||||
+ _77 = opaque::<i16>(const 1_i16) -> [return: bb26, unwind unreachable];
|
||||
}
|
||||
|
||||
bb26: {
|
||||
|
@ -477,9 +501,10 @@
|
|||
- _82 = _3;
|
||||
- _81 = move _82 as i32 (FloatToInt);
|
||||
+ _82 = const 1f64;
|
||||
+ _81 = const 1f64 as i32 (FloatToInt);
|
||||
+ _81 = const 1_i32;
|
||||
StorageDead(_82);
|
||||
_80 = opaque::<i32>(move _81) -> [return: bb27, unwind unreachable];
|
||||
- _80 = opaque::<i32>(move _81) -> [return: bb27, unwind unreachable];
|
||||
+ _80 = opaque::<i32>(const 1_i32) -> [return: bb27, unwind unreachable];
|
||||
}
|
||||
|
||||
bb27: {
|
||||
|
@ -491,9 +516,10 @@
|
|||
- _85 = _3;
|
||||
- _84 = move _85 as i64 (FloatToInt);
|
||||
+ _85 = const 1f64;
|
||||
+ _84 = const 1f64 as i64 (FloatToInt);
|
||||
+ _84 = const 1_i64;
|
||||
StorageDead(_85);
|
||||
_83 = opaque::<i64>(move _84) -> [return: bb28, unwind unreachable];
|
||||
- _83 = opaque::<i64>(move _84) -> [return: bb28, unwind unreachable];
|
||||
+ _83 = opaque::<i64>(const 1_i64) -> [return: bb28, unwind unreachable];
|
||||
}
|
||||
|
||||
bb28: {
|
||||
|
@ -505,9 +531,10 @@
|
|||
- _88 = _3;
|
||||
- _87 = move _88 as f32 (FloatToFloat);
|
||||
+ _88 = const 1f64;
|
||||
+ _87 = const 1f64 as f32 (FloatToFloat);
|
||||
+ _87 = const 1f32;
|
||||
StorageDead(_88);
|
||||
_86 = opaque::<f32>(move _87) -> [return: bb29, unwind unreachable];
|
||||
- _86 = opaque::<f32>(move _87) -> [return: bb29, unwind unreachable];
|
||||
+ _86 = opaque::<f32>(const 1f32) -> [return: bb29, unwind unreachable];
|
||||
}
|
||||
|
||||
bb29: {
|
||||
|
|
|
@ -119,9 +119,10 @@
|
|||
- _6 = _1;
|
||||
- _5 = move _6 as u8 (IntToInt);
|
||||
+ _6 = const 1_i64;
|
||||
+ _5 = const 1_i64 as u8 (IntToInt);
|
||||
+ _5 = const 1_u8;
|
||||
StorageDead(_6);
|
||||
_4 = opaque::<u8>(move _5) -> [return: bb1, unwind continue];
|
||||
- _4 = opaque::<u8>(move _5) -> [return: bb1, unwind continue];
|
||||
+ _4 = opaque::<u8>(const 1_u8) -> [return: bb1, unwind continue];
|
||||
}
|
||||
|
||||
bb1: {
|
||||
|
@ -133,9 +134,10 @@
|
|||
- _9 = _1;
|
||||
- _8 = move _9 as u16 (IntToInt);
|
||||
+ _9 = const 1_i64;
|
||||
+ _8 = const 1_i64 as u16 (IntToInt);
|
||||
+ _8 = const 1_u16;
|
||||
StorageDead(_9);
|
||||
_7 = opaque::<u16>(move _8) -> [return: bb2, unwind continue];
|
||||
- _7 = opaque::<u16>(move _8) -> [return: bb2, unwind continue];
|
||||
+ _7 = opaque::<u16>(const 1_u16) -> [return: bb2, unwind continue];
|
||||
}
|
||||
|
||||
bb2: {
|
||||
|
@ -147,9 +149,10 @@
|
|||
- _12 = _1;
|
||||
- _11 = move _12 as u32 (IntToInt);
|
||||
+ _12 = const 1_i64;
|
||||
+ _11 = const 1_i64 as u32 (IntToInt);
|
||||
+ _11 = const 1_u32;
|
||||
StorageDead(_12);
|
||||
_10 = opaque::<u32>(move _11) -> [return: bb3, unwind continue];
|
||||
- _10 = opaque::<u32>(move _11) -> [return: bb3, unwind continue];
|
||||
+ _10 = opaque::<u32>(const 1_u32) -> [return: bb3, unwind continue];
|
||||
}
|
||||
|
||||
bb3: {
|
||||
|
@ -161,9 +164,10 @@
|
|||
- _15 = _1;
|
||||
- _14 = move _15 as u64 (IntToInt);
|
||||
+ _15 = const 1_i64;
|
||||
+ _14 = const 1_i64 as u64 (IntToInt);
|
||||
+ _14 = const 1_u64;
|
||||
StorageDead(_15);
|
||||
_13 = opaque::<u64>(move _14) -> [return: bb4, unwind continue];
|
||||
- _13 = opaque::<u64>(move _14) -> [return: bb4, unwind continue];
|
||||
+ _13 = opaque::<u64>(const 1_u64) -> [return: bb4, unwind continue];
|
||||
}
|
||||
|
||||
bb4: {
|
||||
|
@ -175,9 +179,10 @@
|
|||
- _18 = _1;
|
||||
- _17 = move _18 as i8 (IntToInt);
|
||||
+ _18 = const 1_i64;
|
||||
+ _17 = const 1_i64 as i8 (IntToInt);
|
||||
+ _17 = const 1_i8;
|
||||
StorageDead(_18);
|
||||
_16 = opaque::<i8>(move _17) -> [return: bb5, unwind continue];
|
||||
- _16 = opaque::<i8>(move _17) -> [return: bb5, unwind continue];
|
||||
+ _16 = opaque::<i8>(const 1_i8) -> [return: bb5, unwind continue];
|
||||
}
|
||||
|
||||
bb5: {
|
||||
|
@ -189,9 +194,10 @@
|
|||
- _21 = _1;
|
||||
- _20 = move _21 as i16 (IntToInt);
|
||||
+ _21 = const 1_i64;
|
||||
+ _20 = const 1_i64 as i16 (IntToInt);
|
||||
+ _20 = const 1_i16;
|
||||
StorageDead(_21);
|
||||
_19 = opaque::<i16>(move _20) -> [return: bb6, unwind continue];
|
||||
- _19 = opaque::<i16>(move _20) -> [return: bb6, unwind continue];
|
||||
+ _19 = opaque::<i16>(const 1_i16) -> [return: bb6, unwind continue];
|
||||
}
|
||||
|
||||
bb6: {
|
||||
|
@ -203,9 +209,10 @@
|
|||
- _24 = _1;
|
||||
- _23 = move _24 as i32 (IntToInt);
|
||||
+ _24 = const 1_i64;
|
||||
+ _23 = const 1_i64 as i32 (IntToInt);
|
||||
+ _23 = const 1_i32;
|
||||
StorageDead(_24);
|
||||
_22 = opaque::<i32>(move _23) -> [return: bb7, unwind continue];
|
||||
- _22 = opaque::<i32>(move _23) -> [return: bb7, unwind continue];
|
||||
+ _22 = opaque::<i32>(const 1_i32) -> [return: bb7, unwind continue];
|
||||
}
|
||||
|
||||
bb7: {
|
||||
|
@ -228,9 +235,10 @@
|
|||
- _29 = _1;
|
||||
- _28 = move _29 as f32 (IntToFloat);
|
||||
+ _29 = const 1_i64;
|
||||
+ _28 = const 1_i64 as f32 (IntToFloat);
|
||||
+ _28 = const 1f32;
|
||||
StorageDead(_29);
|
||||
_27 = opaque::<f32>(move _28) -> [return: bb9, unwind continue];
|
||||
- _27 = opaque::<f32>(move _28) -> [return: bb9, unwind continue];
|
||||
+ _27 = opaque::<f32>(const 1f32) -> [return: bb9, unwind continue];
|
||||
}
|
||||
|
||||
bb9: {
|
||||
|
@ -242,9 +250,10 @@
|
|||
- _32 = _1;
|
||||
- _31 = move _32 as f64 (IntToFloat);
|
||||
+ _32 = const 1_i64;
|
||||
+ _31 = const 1_i64 as f64 (IntToFloat);
|
||||
+ _31 = const 1f64;
|
||||
StorageDead(_32);
|
||||
_30 = opaque::<f64>(move _31) -> [return: bb10, unwind continue];
|
||||
- _30 = opaque::<f64>(move _31) -> [return: bb10, unwind continue];
|
||||
+ _30 = opaque::<f64>(const 1f64) -> [return: bb10, unwind continue];
|
||||
}
|
||||
|
||||
bb10: {
|
||||
|
@ -256,9 +265,10 @@
|
|||
- _35 = _2;
|
||||
- _34 = move _35 as u8 (IntToInt);
|
||||
+ _35 = const 1_u64;
|
||||
+ _34 = const 1_u64 as u8 (IntToInt);
|
||||
+ _34 = const 1_u8;
|
||||
StorageDead(_35);
|
||||
_33 = opaque::<u8>(move _34) -> [return: bb11, unwind continue];
|
||||
- _33 = opaque::<u8>(move _34) -> [return: bb11, unwind continue];
|
||||
+ _33 = opaque::<u8>(const 1_u8) -> [return: bb11, unwind continue];
|
||||
}
|
||||
|
||||
bb11: {
|
||||
|
@ -270,9 +280,10 @@
|
|||
- _38 = _2;
|
||||
- _37 = move _38 as u16 (IntToInt);
|
||||
+ _38 = const 1_u64;
|
||||
+ _37 = const 1_u64 as u16 (IntToInt);
|
||||
+ _37 = const 1_u16;
|
||||
StorageDead(_38);
|
||||
_36 = opaque::<u16>(move _37) -> [return: bb12, unwind continue];
|
||||
- _36 = opaque::<u16>(move _37) -> [return: bb12, unwind continue];
|
||||
+ _36 = opaque::<u16>(const 1_u16) -> [return: bb12, unwind continue];
|
||||
}
|
||||
|
||||
bb12: {
|
||||
|
@ -284,9 +295,10 @@
|
|||
- _41 = _2;
|
||||
- _40 = move _41 as u32 (IntToInt);
|
||||
+ _41 = const 1_u64;
|
||||
+ _40 = const 1_u64 as u32 (IntToInt);
|
||||
+ _40 = const 1_u32;
|
||||
StorageDead(_41);
|
||||
_39 = opaque::<u32>(move _40) -> [return: bb13, unwind continue];
|
||||
- _39 = opaque::<u32>(move _40) -> [return: bb13, unwind continue];
|
||||
+ _39 = opaque::<u32>(const 1_u32) -> [return: bb13, unwind continue];
|
||||
}
|
||||
|
||||
bb13: {
|
||||
|
@ -309,9 +321,10 @@
|
|||
- _46 = _2;
|
||||
- _45 = move _46 as i8 (IntToInt);
|
||||
+ _46 = const 1_u64;
|
||||
+ _45 = const 1_u64 as i8 (IntToInt);
|
||||
+ _45 = const 1_i8;
|
||||
StorageDead(_46);
|
||||
_44 = opaque::<i8>(move _45) -> [return: bb15, unwind continue];
|
||||
- _44 = opaque::<i8>(move _45) -> [return: bb15, unwind continue];
|
||||
+ _44 = opaque::<i8>(const 1_i8) -> [return: bb15, unwind continue];
|
||||
}
|
||||
|
||||
bb15: {
|
||||
|
@ -323,9 +336,10 @@
|
|||
- _49 = _2;
|
||||
- _48 = move _49 as i16 (IntToInt);
|
||||
+ _49 = const 1_u64;
|
||||
+ _48 = const 1_u64 as i16 (IntToInt);
|
||||
+ _48 = const 1_i16;
|
||||
StorageDead(_49);
|
||||
_47 = opaque::<i16>(move _48) -> [return: bb16, unwind continue];
|
||||
- _47 = opaque::<i16>(move _48) -> [return: bb16, unwind continue];
|
||||
+ _47 = opaque::<i16>(const 1_i16) -> [return: bb16, unwind continue];
|
||||
}
|
||||
|
||||
bb16: {
|
||||
|
@ -337,9 +351,10 @@
|
|||
- _52 = _2;
|
||||
- _51 = move _52 as i32 (IntToInt);
|
||||
+ _52 = const 1_u64;
|
||||
+ _51 = const 1_u64 as i32 (IntToInt);
|
||||
+ _51 = const 1_i32;
|
||||
StorageDead(_52);
|
||||
_50 = opaque::<i32>(move _51) -> [return: bb17, unwind continue];
|
||||
- _50 = opaque::<i32>(move _51) -> [return: bb17, unwind continue];
|
||||
+ _50 = opaque::<i32>(const 1_i32) -> [return: bb17, unwind continue];
|
||||
}
|
||||
|
||||
bb17: {
|
||||
|
@ -351,9 +366,10 @@
|
|||
- _55 = _2;
|
||||
- _54 = move _55 as i64 (IntToInt);
|
||||
+ _55 = const 1_u64;
|
||||
+ _54 = const 1_u64 as i64 (IntToInt);
|
||||
+ _54 = const 1_i64;
|
||||
StorageDead(_55);
|
||||
_53 = opaque::<i64>(move _54) -> [return: bb18, unwind continue];
|
||||
- _53 = opaque::<i64>(move _54) -> [return: bb18, unwind continue];
|
||||
+ _53 = opaque::<i64>(const 1_i64) -> [return: bb18, unwind continue];
|
||||
}
|
||||
|
||||
bb18: {
|
||||
|
@ -365,9 +381,10 @@
|
|||
- _58 = _2;
|
||||
- _57 = move _58 as f32 (IntToFloat);
|
||||
+ _58 = const 1_u64;
|
||||
+ _57 = const 1_u64 as f32 (IntToFloat);
|
||||
+ _57 = const 1f32;
|
||||
StorageDead(_58);
|
||||
_56 = opaque::<f32>(move _57) -> [return: bb19, unwind continue];
|
||||
- _56 = opaque::<f32>(move _57) -> [return: bb19, unwind continue];
|
||||
+ _56 = opaque::<f32>(const 1f32) -> [return: bb19, unwind continue];
|
||||
}
|
||||
|
||||
bb19: {
|
||||
|
@ -379,9 +396,10 @@
|
|||
- _61 = _2;
|
||||
- _60 = move _61 as f64 (IntToFloat);
|
||||
+ _61 = const 1_u64;
|
||||
+ _60 = const 1_u64 as f64 (IntToFloat);
|
||||
+ _60 = const 1f64;
|
||||
StorageDead(_61);
|
||||
_59 = opaque::<f64>(move _60) -> [return: bb20, unwind continue];
|
||||
- _59 = opaque::<f64>(move _60) -> [return: bb20, unwind continue];
|
||||
+ _59 = opaque::<f64>(const 1f64) -> [return: bb20, unwind continue];
|
||||
}
|
||||
|
||||
bb20: {
|
||||
|
@ -393,9 +411,10 @@
|
|||
- _64 = _3;
|
||||
- _63 = move _64 as u8 (FloatToInt);
|
||||
+ _64 = const 1f64;
|
||||
+ _63 = const 1f64 as u8 (FloatToInt);
|
||||
+ _63 = const 1_u8;
|
||||
StorageDead(_64);
|
||||
_62 = opaque::<u8>(move _63) -> [return: bb21, unwind continue];
|
||||
- _62 = opaque::<u8>(move _63) -> [return: bb21, unwind continue];
|
||||
+ _62 = opaque::<u8>(const 1_u8) -> [return: bb21, unwind continue];
|
||||
}
|
||||
|
||||
bb21: {
|
||||
|
@ -407,9 +426,10 @@
|
|||
- _67 = _3;
|
||||
- _66 = move _67 as u16 (FloatToInt);
|
||||
+ _67 = const 1f64;
|
||||
+ _66 = const 1f64 as u16 (FloatToInt);
|
||||
+ _66 = const 1_u16;
|
||||
StorageDead(_67);
|
||||
_65 = opaque::<u16>(move _66) -> [return: bb22, unwind continue];
|
||||
- _65 = opaque::<u16>(move _66) -> [return: bb22, unwind continue];
|
||||
+ _65 = opaque::<u16>(const 1_u16) -> [return: bb22, unwind continue];
|
||||
}
|
||||
|
||||
bb22: {
|
||||
|
@ -421,9 +441,10 @@
|
|||
- _70 = _3;
|
||||
- _69 = move _70 as u32 (FloatToInt);
|
||||
+ _70 = const 1f64;
|
||||
+ _69 = const 1f64 as u32 (FloatToInt);
|
||||
+ _69 = const 1_u32;
|
||||
StorageDead(_70);
|
||||
_68 = opaque::<u32>(move _69) -> [return: bb23, unwind continue];
|
||||
- _68 = opaque::<u32>(move _69) -> [return: bb23, unwind continue];
|
||||
+ _68 = opaque::<u32>(const 1_u32) -> [return: bb23, unwind continue];
|
||||
}
|
||||
|
||||
bb23: {
|
||||
|
@ -435,9 +456,10 @@
|
|||
- _73 = _3;
|
||||
- _72 = move _73 as u64 (FloatToInt);
|
||||
+ _73 = const 1f64;
|
||||
+ _72 = const 1f64 as u64 (FloatToInt);
|
||||
+ _72 = const 1_u64;
|
||||
StorageDead(_73);
|
||||
_71 = opaque::<u64>(move _72) -> [return: bb24, unwind continue];
|
||||
- _71 = opaque::<u64>(move _72) -> [return: bb24, unwind continue];
|
||||
+ _71 = opaque::<u64>(const 1_u64) -> [return: bb24, unwind continue];
|
||||
}
|
||||
|
||||
bb24: {
|
||||
|
@ -449,9 +471,10 @@
|
|||
- _76 = _3;
|
||||
- _75 = move _76 as i8 (FloatToInt);
|
||||
+ _76 = const 1f64;
|
||||
+ _75 = const 1f64 as i8 (FloatToInt);
|
||||
+ _75 = const 1_i8;
|
||||
StorageDead(_76);
|
||||
_74 = opaque::<i8>(move _75) -> [return: bb25, unwind continue];
|
||||
- _74 = opaque::<i8>(move _75) -> [return: bb25, unwind continue];
|
||||
+ _74 = opaque::<i8>(const 1_i8) -> [return: bb25, unwind continue];
|
||||
}
|
||||
|
||||
bb25: {
|
||||
|
@ -463,9 +486,10 @@
|
|||
- _79 = _3;
|
||||
- _78 = move _79 as i16 (FloatToInt);
|
||||
+ _79 = const 1f64;
|
||||
+ _78 = const 1f64 as i16 (FloatToInt);
|
||||
+ _78 = const 1_i16;
|
||||
StorageDead(_79);
|
||||
_77 = opaque::<i16>(move _78) -> [return: bb26, unwind continue];
|
||||
- _77 = opaque::<i16>(move _78) -> [return: bb26, unwind continue];
|
||||
+ _77 = opaque::<i16>(const 1_i16) -> [return: bb26, unwind continue];
|
||||
}
|
||||
|
||||
bb26: {
|
||||
|
@ -477,9 +501,10 @@
|
|||
- _82 = _3;
|
||||
- _81 = move _82 as i32 (FloatToInt);
|
||||
+ _82 = const 1f64;
|
||||
+ _81 = const 1f64 as i32 (FloatToInt);
|
||||
+ _81 = const 1_i32;
|
||||
StorageDead(_82);
|
||||
_80 = opaque::<i32>(move _81) -> [return: bb27, unwind continue];
|
||||
- _80 = opaque::<i32>(move _81) -> [return: bb27, unwind continue];
|
||||
+ _80 = opaque::<i32>(const 1_i32) -> [return: bb27, unwind continue];
|
||||
}
|
||||
|
||||
bb27: {
|
||||
|
@ -491,9 +516,10 @@
|
|||
- _85 = _3;
|
||||
- _84 = move _85 as i64 (FloatToInt);
|
||||
+ _85 = const 1f64;
|
||||
+ _84 = const 1f64 as i64 (FloatToInt);
|
||||
+ _84 = const 1_i64;
|
||||
StorageDead(_85);
|
||||
_83 = opaque::<i64>(move _84) -> [return: bb28, unwind continue];
|
||||
- _83 = opaque::<i64>(move _84) -> [return: bb28, unwind continue];
|
||||
+ _83 = opaque::<i64>(const 1_i64) -> [return: bb28, unwind continue];
|
||||
}
|
||||
|
||||
bb28: {
|
||||
|
@ -505,9 +531,10 @@
|
|||
- _88 = _3;
|
||||
- _87 = move _88 as f32 (FloatToFloat);
|
||||
+ _88 = const 1f64;
|
||||
+ _87 = const 1f64 as f32 (FloatToFloat);
|
||||
+ _87 = const 1f32;
|
||||
StorageDead(_88);
|
||||
_86 = opaque::<f32>(move _87) -> [return: bb29, unwind continue];
|
||||
- _86 = opaque::<f32>(move _87) -> [return: bb29, unwind continue];
|
||||
+ _86 = opaque::<f32>(const 1f32) -> [return: bb29, unwind continue];
|
||||
}
|
||||
|
||||
bb29: {
|
||||
|
|
|
@ -176,12 +176,13 @@
|
|||
StorageDead(_19);
|
||||
StorageDead(_18);
|
||||
- StorageLive(_21);
|
||||
- _21 = core::panicking::AssertKind::Eq;
|
||||
+ nop;
|
||||
_21 = core::panicking::AssertKind::Eq;
|
||||
+ _21 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_22);
|
||||
StorageLive(_23);
|
||||
- _23 = move _21;
|
||||
+ _23 = _21;
|
||||
+ _23 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_24);
|
||||
StorageLive(_25);
|
||||
_25 = &(*_15);
|
||||
|
@ -193,7 +194,7 @@
|
|||
StorageLive(_28);
|
||||
_28 = Option::<Arguments<'_>>::None;
|
||||
- _22 = core::panicking::assert_failed::<*const u8, *const u8>(move _23, move _24, move _26, move _28) -> unwind unreachable;
|
||||
+ _22 = core::panicking::assert_failed::<*const u8, *const u8>(_21, move _24, move _26, move _28) -> unwind unreachable;
|
||||
+ _22 = core::panicking::assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _24, move _26, move _28) -> unwind unreachable;
|
||||
}
|
||||
|
||||
bb7: {
|
||||
|
@ -261,12 +262,13 @@
|
|||
StorageDead(_45);
|
||||
StorageDead(_44);
|
||||
- StorageLive(_47);
|
||||
- _47 = core::panicking::AssertKind::Eq;
|
||||
+ nop;
|
||||
_47 = core::panicking::AssertKind::Eq;
|
||||
+ _47 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_48);
|
||||
StorageLive(_49);
|
||||
- _49 = move _47;
|
||||
+ _49 = _47;
|
||||
+ _49 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_50);
|
||||
StorageLive(_51);
|
||||
_51 = &(*_41);
|
||||
|
@ -278,7 +280,7 @@
|
|||
StorageLive(_54);
|
||||
_54 = Option::<Arguments<'_>>::None;
|
||||
- _48 = core::panicking::assert_failed::<*const u8, *const u8>(move _49, move _50, move _52, move _54) -> unwind unreachable;
|
||||
+ _48 = core::panicking::assert_failed::<*const u8, *const u8>(_47, move _50, move _52, move _54) -> unwind unreachable;
|
||||
+ _48 = core::panicking::assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _50, move _52, move _54) -> unwind unreachable;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -176,12 +176,13 @@
|
|||
StorageDead(_19);
|
||||
StorageDead(_18);
|
||||
- StorageLive(_21);
|
||||
- _21 = core::panicking::AssertKind::Eq;
|
||||
+ nop;
|
||||
_21 = core::panicking::AssertKind::Eq;
|
||||
+ _21 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_22);
|
||||
StorageLive(_23);
|
||||
- _23 = move _21;
|
||||
+ _23 = _21;
|
||||
+ _23 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_24);
|
||||
StorageLive(_25);
|
||||
_25 = &(*_15);
|
||||
|
@ -193,7 +194,7 @@
|
|||
StorageLive(_28);
|
||||
_28 = Option::<Arguments<'_>>::None;
|
||||
- _22 = core::panicking::assert_failed::<*const u8, *const u8>(move _23, move _24, move _26, move _28) -> unwind continue;
|
||||
+ _22 = core::panicking::assert_failed::<*const u8, *const u8>(_21, move _24, move _26, move _28) -> unwind continue;
|
||||
+ _22 = core::panicking::assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _24, move _26, move _28) -> unwind continue;
|
||||
}
|
||||
|
||||
bb7: {
|
||||
|
@ -261,12 +262,13 @@
|
|||
StorageDead(_45);
|
||||
StorageDead(_44);
|
||||
- StorageLive(_47);
|
||||
- _47 = core::panicking::AssertKind::Eq;
|
||||
+ nop;
|
||||
_47 = core::panicking::AssertKind::Eq;
|
||||
+ _47 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_48);
|
||||
StorageLive(_49);
|
||||
- _49 = move _47;
|
||||
+ _49 = _47;
|
||||
+ _49 = const core::panicking::AssertKind::Eq;
|
||||
StorageLive(_50);
|
||||
StorageLive(_51);
|
||||
_51 = &(*_41);
|
||||
|
@ -278,7 +280,7 @@
|
|||
StorageLive(_54);
|
||||
_54 = Option::<Arguments<'_>>::None;
|
||||
- _48 = core::panicking::assert_failed::<*const u8, *const u8>(move _49, move _50, move _52, move _54) -> unwind continue;
|
||||
+ _48 = core::panicking::assert_failed::<*const u8, *const u8>(_47, move _50, move _52, move _54) -> unwind continue;
|
||||
+ _48 = core::panicking::assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _50, move _52, move _54) -> unwind continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue