Avoid a temporary stackslot in codegen_checked_int_binop
This commit is contained in:
parent
b0f870edd6
commit
74f39b64c8
1 changed files with 4 additions and 11 deletions
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);
|
let has_overflow = fx.bcx.ins().bint(types::I8, has_overflow);
|
||||||
|
|
||||||
// FIXME directly write to result place instead
|
let out_layout = fx.layout_of(
|
||||||
let out_place = CPlace::new_stack_slot(
|
fx.tcx
|
||||||
fx,
|
.mk_tup([in_lhs.layout().ty, fx.tcx.types.bool].iter()),
|
||||||
fx.layout_of(
|
|
||||||
fx.tcx
|
|
||||||
.mk_tup([in_lhs.layout().ty, fx.tcx.types.bool].iter()),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
let out_layout = out_place.layout();
|
CValue::by_val_pair(res, has_overflow, out_layout)
|
||||||
out_place.write_cvalue(fx, CValue::by_val_pair(res, has_overflow, out_layout));
|
|
||||||
|
|
||||||
out_place.to_cvalue(fx)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn codegen_float_binop<'tcx>(
|
pub(crate) fn codegen_float_binop<'tcx>(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue