Statistics
| Branch: | Revision:

root / tcg @ b202d41e

Name Size
  arm
  hppa
  i386
  ia64
  mips
  ppc
  ppc64
  s390
  sparc
  tci
LICENSE 146 Bytes
README 15.2 kB
TODO 394 Bytes
optimize.c 29.5 kB
tcg-op.h 84.6 kB
tcg-opc.h 9.3 kB
tcg-runtime.h 706 Bytes
tcg.c 80.7 kB
tcg.h 18.9 kB

Latest revisions

# Date Author Comment
c29c1d7e 10/28/2012 03:54 pm Aurelien Jarno

tcg: rewrite tcg_reg_alloc_mov()

Now that the liveness analysis provides more information, rewrite
tcg_reg_alloc_mov(). This changes the behaviour about propagating
constants and memory accesses. We now take the assumption that once
a value is loaded into a register (from memory or from a constant),...

a52ad07e 10/28/2012 03:54 pm Aurelien Jarno

tcg: always mark dead input arguments as dead

Always mark dead input arguments as dead, even if the op is at the basic
block end. This will allow to check that all temps are correctly saved.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

7dfd8c6a 10/28/2012 03:54 pm Aurelien Jarno

tcg: start with local temps in TEMP_VAL_MEM state

Start with local temps in TEMP_VAL_MEM state, to make possible a later
check that all the temps are correctly saved back to memory.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

2c0366f0 10/28/2012 03:54 pm Aurelien Jarno

tcg: don't explicitly save globals and temps

The liveness analysis ensures that globals and temps are at the correct
state at a basic block end or with an op with side effects. Avoid
looping on all temps, this can be time consuming on targets with a lot
of globals. Keep an assert in debug mode....

344028ba 10/28/2012 03:54 pm Aurelien Jarno

tcg: fix some op flags

Some branch related ops are marked with TCG_OPF_SIDE_EFFECTS, some other
not. In practice they don't need to, as they are all marked with
TCG_OPF_BB_END, which is handled specifically in all the code.

The call op is marked as TCG_OPF_SIDE_EFFECTS, which might be not true...

b202d41e 10/28/2012 03:54 pm Aurelien Jarno

tcg: forbid ld/st function to modify globals

Mapping a memory address using a global and accessing it through
ld/st operations is currently broken. As it doesn't make any sense
to do that performance wise, let's forbid that.

Update the TCG documentation, and remove partial support for that....

1ad80729 10/28/2012 03:54 pm Aurelien Jarno

tcg: add temp_sync()

Add a new function temp_sync() to synchronize the canonical location
of a temp with the value in the corresponding register, but without
freeing the associated register. Rewrite temp_save() to call
temp_sync() followed by temp_dead()....

ec7a869d 10/28/2012 03:54 pm Aurelien Jarno

tcg: sync output arguments on liveness request

Synchronize an output argument when requested by the liveness analysis.
This is needed so that the temp can be declared dead later.

For that, add a new op_sync_args table in which each bit tells if the
corresponding output argument needs to be synchronized with the memory....

9c43b68d 10/28/2012 03:54 pm Aurelien Jarno

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...

4c4e1ab2 10/28/2012 03:54 pm Aurelien Jarno

tcg: improve tcg_reg_alloc_movi()

Now that the liveness analysis might mark some output temps as dead, call
temp_dead() if needed.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

View revisions

Also available in: Atom