Avoid a temporary stackslot in codegen_checked_int_binop

This commit is contained in:
bjorn3 2021-02-21 12:48:43 +01:00
parent b0f870edd6
commit 74f39b64c8

View File

@ -328,18 +328,11 @@ pub(crate) fn codegen_checked_int_binop<'tcx>(
let has_overflow = fx.bcx.ins().bint(types::I8, has_overflow);
// FIXME directly write to result place instead
let out_place = CPlace::new_stack_slot(
fx,
fx.layout_of(
fx.tcx
.mk_tup([in_lhs.layout().ty, fx.tcx.types.bool].iter()),
),
let out_layout = fx.layout_of(
fx.tcx
.mk_tup([in_lhs.layout().ty, fx.tcx.types.bool].iter()),
);
let out_layout = out_place.layout();
out_place.write_cvalue(fx, CValue::by_val_pair(res, has_overflow, out_layout));
out_place.to_cvalue(fx)
CValue::by_val_pair(res, has_overflow, out_layout)
}
pub(crate) fn codegen_float_binop<'tcx>(