tcg: Improve call argument loading
Free the argument register only after we have verified that the temporary is not already in that register. This case is likely now that we are back propagating the preferred register. Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
25f49c5f15
commit
4250da1092
@ -3611,15 +3611,16 @@ static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op)
|
|||||||
if (arg != TCG_CALL_DUMMY_ARG) {
|
if (arg != TCG_CALL_DUMMY_ARG) {
|
||||||
ts = arg_temp(arg);
|
ts = arg_temp(arg);
|
||||||
reg = tcg_target_call_iarg_regs[i];
|
reg = tcg_target_call_iarg_regs[i];
|
||||||
tcg_reg_free(s, reg, allocated_regs);
|
|
||||||
|
|
||||||
if (ts->val_type == TEMP_VAL_REG) {
|
if (ts->val_type == TEMP_VAL_REG) {
|
||||||
if (ts->reg != reg) {
|
if (ts->reg != reg) {
|
||||||
|
tcg_reg_free(s, reg, allocated_regs);
|
||||||
tcg_out_mov(s, ts->type, reg, ts->reg);
|
tcg_out_mov(s, ts->type, reg, ts->reg);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TCGRegSet arg_set = 0;
|
TCGRegSet arg_set = 0;
|
||||||
|
|
||||||
|
tcg_reg_free(s, reg, allocated_regs);
|
||||||
tcg_regset_set_reg(arg_set, reg);
|
tcg_regset_set_reg(arg_set, reg);
|
||||||
temp_load(s, ts, arg_set, allocated_regs, 0);
|
temp_load(s, ts, arg_set, allocated_regs, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user