Avoid a temporary stackslot in codegen_checked_int_binop
This commit is contained in:
parent
b0f870edd6
commit
74f39b64c8
15
src/num.rs
15
src/num.rs
@ -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>(
|
||||
|
Loading…
x
Reference in New Issue
Block a user