tcg: Add preferred_reg argument to tcg_reg_alloc
commitb016486e7baddb43cfc1e51909b05cde9cf82e0c
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 27 Nov 2018 15:16:21 +0000 (27 07:16 -0800)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 25 Dec 2018 19:57:06 +0000 (26 06:57 +1100)
treead3d1ce59e64817f5456dfd2fa60dd5aa74c44a2
parentb4fc67c7afd2c338d6e7c73a7f428dfe05ae0603
tcg: Add preferred_reg argument to tcg_reg_alloc

This new argument will aid register allocation by indicating how
the temporary will be used in future.  If the preference cannot
be satisfied, fall back to the constraints of the current insn.

Short circuit the preference when it cannot be satisfied or if
it does not further constrain the operation.

With an eye toward optimizing function call sequences, optimize
for the preferred_reg set containing a single register.

For the moment, all users pass 0 for preference.

Reviewed-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
tcg/tcg.c