1
Fork 0

Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix

Test the effect of shrinking the size of Rvalue by 16 bytes

r? `@ghost`
This commit is contained in:
bors 2021-03-08 08:39:24 +00:00
commit 27885a94c6
29 changed files with 94 additions and 66 deletions

View file

@ -667,7 +667,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
block,
source_info,
lt,
Rvalue::BinaryOp(BinOp::Lt, Operand::Copy(Place::from(index)), Operand::Copy(len)),
Rvalue::BinaryOp(
BinOp::Lt,
box (Operand::Copy(Place::from(index)), Operand::Copy(len)),
),
);
let msg = BoundsCheck { len: Operand::Move(len), index: Operand::Copy(Place::from(index)) };
// assert!(lt, "...")

View file

@ -81,7 +81,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
block,
source_info,
is_min,
Rvalue::BinaryOp(BinOp::Eq, arg.to_copy(), minval),
Rvalue::BinaryOp(BinOp::Eq, box (arg.to_copy(), minval)),
);
block = this.assert(
@ -291,7 +291,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
block,
source_info,
result_value,
Rvalue::CheckedBinaryOp(op, lhs.to_copy(), rhs.to_copy()),
Rvalue::CheckedBinaryOp(op, box (lhs.to_copy(), rhs.to_copy())),
);
let val_fld = Field::new(0);
let of_fld = Field::new(1);
@ -324,7 +324,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
block,
source_info,
is_zero,
Rvalue::BinaryOp(BinOp::Eq, rhs.to_copy(), zero),
Rvalue::BinaryOp(BinOp::Eq, box (rhs.to_copy(), zero)),
);
block = self.assert(block, Operand::Move(is_zero), false, zero_err, span);
@ -345,13 +345,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
block,
source_info,
is_neg_1,
Rvalue::BinaryOp(BinOp::Eq, rhs.to_copy(), neg_1),
Rvalue::BinaryOp(BinOp::Eq, box (rhs.to_copy(), neg_1)),
);
self.cfg.push_assign(
block,
source_info,
is_min,
Rvalue::BinaryOp(BinOp::Eq, lhs.to_copy(), min),
Rvalue::BinaryOp(BinOp::Eq, box (lhs.to_copy(), min)),
);
let is_neg_1 = Operand::Move(is_neg_1);
@ -360,14 +360,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
block,
source_info,
of,
Rvalue::BinaryOp(BinOp::BitAnd, is_neg_1, is_min),
Rvalue::BinaryOp(BinOp::BitAnd, box (is_neg_1, is_min)),
);
block = self.assert(block, Operand::Move(of), false, overflow_err, span);
}
}
block.and(Rvalue::BinaryOp(op, lhs, rhs))
block.and(Rvalue::BinaryOp(op, box (lhs, rhs)))
}
}

View file

@ -335,7 +335,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
let result = self.temp(bool_ty, source_info.span);
// result = op(left, right)
self.cfg.push_assign(block, source_info, result, Rvalue::BinaryOp(op, left, right));
self.cfg.push_assign(block, source_info, result, Rvalue::BinaryOp(op, box (left, right)));
// branch based on result
self.cfg.terminate(