aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2018-12-11 10:25:02 -0600
committerRichard Henderson <richard.henderson@linaro.org>2018-12-26 06:58:43 +1100
commit4250da10923347c9ee907f8d72bd93dfa5ee8742 (patch)
tree7922dee84ebb2b0104a470408c649032392d5ace
parent25f49c5f1508ddf081ce89fa6bbfd87a51eea37b (diff)
downloadqemu-4250da10923347c9ee907f8d72bd93dfa5ee8742.zip
qemu-4250da10923347c9ee907f8d72bd93dfa5ee8742.tar.gz
qemu-4250da10923347c9ee907f8d72bd93dfa5ee8742.tar.bz2
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>
-rw-r--r--tcg/tcg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 5f8c09b..c54b119 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -3611,15 +3611,16 @@ static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op)
if (arg != TCG_CALL_DUMMY_ARG) {
ts = arg_temp(arg);
reg = tcg_target_call_iarg_regs[i];
- tcg_reg_free(s, reg, allocated_regs);
if (ts->val_type == TEMP_VAL_REG) {
if (ts->reg != reg) {
+ tcg_reg_free(s, reg, allocated_regs);
tcg_out_mov(s, ts->type, reg, ts->reg);
}
} else {
TCGRegSet arg_set = 0;
+ tcg_reg_free(s, reg, allocated_regs);
tcg_regset_set_reg(arg_set, reg);
temp_load(s, ts, arg_set, allocated_regs, 0);
}