Skip to content

Cleanups within TCG middle-end

Richard Henderson qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest16 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16tcg: Merge opcode arguments into TCGOptcg/optimize.c tcg/tcg-op.c tcg/tcg.c +1 more+94 -1422 replies
2/16tcg: Propagate args to op->args in optimizertcg/optimize.c+227 -2031 reply
3/16tcg: Propagate args to op->args in tcg.ctcg/tcg.c+58 -632 replies
4/16tcg: Propagate TCGOp down to allocatorstcg/tcg.c+40 -421 reply
5/16tcg: Introduce arg_temptcg/optimize.c tcg/tcg.c tcg/tcg.h+32 -281 reply
6/16tcg: Add temp_global bit to TCGTemptcg/optimize.c tcg/tcg.c tcg/tcg.h+24 -143 replies
7/16tcg: Return NULL temp for TCG_CALL_DUMMY_ARGtcg/tcg.h+1 -12 replies
8/16tcg: Introduce temp_argtcg/tcg.c tcg/tcg.h+9 -20 replies
9/16tcg: Use per-temp state data in livenesstcg/tcg.c tcg/tcg.h+120 -1182 replies
10/16tcg: Avoid loops against variable boundstcg/tcg.c+10 -171 reply
11/16tcg: Change temp_allocate_frame arg to TCGTemptcg/tcg.c+3 -50 replies
12/16tcg: Remove unused TCG_CALL_DUMMY_TCGVtcg/tcg.h+0 -11 reply
13/16tcg: Export temp_idxtcg/tcg.c tcg/tcg.h+10 -122 replies
14/16tcg: Use per-temp state data in optimizetcg/optimize.c tcg/tcg.h+249 -1801 reply
15/16tcg: Define separate structures for TCGv_*tcg/tcg.c tcg/tcg.h+146 -1580 replies
16/16tcg: Store pointers to temporaries directly in TCGArgtcg/tcg.c tcg/tcg.h+12 -100 replies

Reviews trailers per patch

6 of 16 patches have a Reviewed-by or Acked-by.

PatchAlex Bennée
1/16
2/16R-b
3/16R-b
4/16R-b
5/16R-b
6/16
7/16
8/16
9/16
10/16R-b
11/16
12/16R-b
13/16
14/16
15/16
16/16

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 00/16] Cleanups within TCG middle-end

There are two conceptually unrelated cleanups in here, though the second touches many of the same lines as the first, so separating the two would be ugly.

The first is to split gen_opparam_buf and move the pieces into TCGOp. This has two effects: the operands for an op is in the same cacheline as the op, and we get to drop the pointer into gen_opparam_buf, freeing up a register and/or function argument.

The second is to change what value is stored in TCGArg for each TCG temporary. Rather than store the index into tcg_ctx.temps, store the pointer to the temp itself. This allows us to drop some arithmetic on many uses of a temp within the backend.

Making that second change is tricky, as we don't want to miss any of the places that ought to be changed. To do that I introduce a number of helpers.

As a final step I changed the type of TCGOp.args to a structure, and annotated the places that access constant arguments. I found that final patch to be really ugly, so I dropped it. But I'm fairly confident that I've updated all of the non-constant args.

The effect of this is nearly noise, but does reduce code size,

text data bss dec hex filename
6648688 2106408 4486112 13241208 ca0b78 qemu-system-alpha (before)
6627656 2106408 4502496 13236560 c9f950 qemu-system-alpha (after)

or about 21k.

r~

Richard Henderson (16):
tcg: Merge opcode arguments into TCGOp
tcg: Propagate args to op->args in optimizer
tcg: Propagate args to op->args in tcg.c
tcg: Propagate TCGOp down to allocators
tcg: Introduce arg_temp
tcg: Add temp_global bit to TCGTemp
tcg: Return NULL temp for TCG_CALL_DUMMY_ARG
tcg: Introduce temp_arg
tcg: Use per-temp state data in liveness
tcg: Avoid loops against variable bounds
tcg: Change temp_allocate_frame arg to TCGTemp
tcg: Remove unused TCG_CALL_DUMMY_TCGV
tcg: Export temp_idx
tcg: Use per-temp state data in optimize
tcg: Define separate structures for TCGv_*
tcg: Store pointers to temporaries directly in TCGArg

 tcg/optimize.c | 647 ++++++++++++++++++++++++++++++++-------------------------
 tcg/tcg-op.c   |  99 ++++-----
 tcg/tcg.c      | 610 ++++++++++++++++++++++++-----------------------------
 tcg/tcg.h      | 287 ++++++++++++++-----------
 4 files changed, 841 insertions(+), 802 deletions(-)
Signature · 1 line
2.9.4