tcg: rework liveness analysis
authorAurelien Jarno <aurelien@aurel32.net>
Tue, 9 Oct 2012 19:53:07 +0000 (21:53 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 28 Oct 2012 13:54:21 +0000 (14:54 +0100)
commit9c43b68de628a1e2cba556adfb71c17028eb802e
tree835d7ebc0d87f635d661481632e743fd2131e6d3
parentec7a869d31a1f82fe5b7750d8952c26753ea1df8
tcg: rework liveness analysis

Rework the liveness analysis by tracking temps that need to go back to
memory in addition to dead temps tracking. This allows to mark output
arguments as "need sync", and to synchronize them back to memory as soon
as they are not written anymore. This way even arguments mapping to
globals can be marked as "dead", avoiding moves to a new register when
input and outputs are aliased.

In addition it means that registers are freed as soon as temps are not
used anymore, instead of waiting for a basic block end or an op with side
effects. This reduces register spilling especially on CPUs with few
registers, and spread the mov over all the TB, increasing the
performances on in-order CPUs.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg/tcg.c