We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6de604b commit ac4f464Copy full SHA for ac4f464
compiler/rustc_mir_transform/src/gvn.rs
@@ -1488,6 +1488,14 @@ impl<'tcx> VnState<'_, 'tcx> {
1488
if let Value::Constant { value, disambiguator: _ } = value
1489
&& value.is_deterministic()
1490
{
1491
+ // Prevent code bloat that makes
1492
+ // `_2 = _1` now resolved to `_2 = <evaluated array>`.
1493
+ if let Const::Val(_, ty) = value
1494
+ && ty.is_array()
1495
+ && self.rev_locals[index].len() > 1
1496
+ {
1497
+ return None;
1498
+ }
1499
return Some(ConstOperand { span: DUMMY_SP, user_ty: None, const_: *value });
1500
}
1501
0 commit comments