On 8/18/26 10:42, Matt Turner wrote:
Every translation block stores to cpu->neg.can_do_io twice: false before
the first instruction, true before the last one. Nothing reads it in a
user-only build. There is no memory-mapped I/O in linux-user, and every
reader is in system_ss: cputlb.c, watchpoint.c, icount-common.c and
tcg-accel-ops-icount.c.

Two stores per TB is not much on its own, but TBs are short. An emulated
alpha gcc 16.2.0 compiling the SQLite 3.45.1 amalgamation (255k lines,
-O2) executes 34.2 billion TBs at 6.04 guest instructions each, so this is
68 billion stores for nothing.

Measured on an x86-64 host, LTO build, on top of the preceding two
patches:

     before: 1,469,729,281,442 instructions
     after:  1,402,816,253,499 instructions   -4.55%

     before: 120.97s wall clock
     after:  115.75s wall clock              -4.32%

The emulated compiler produces byte-identical output.

Signed-off-by: Matt Turner<[email protected]>
---
  accel/tcg/translator.c | 7 +++++++
  1 file changed, 7 insertions(+)

Good catch.

Reviewed-by: Richard Henderson <[email protected]>


r~

Reply via email to