qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] eabb7b: tcg: use tcg_debug_assert instead of


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] eabb7b: tcg: use tcg_debug_assert instead of assert (fix p...
Date: Thu, 21 Apr 2016 09:00:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: eabb7b91b36b202b4dac2df2d59d698e3aff197a
      
https://github.com/qemu/qemu/commit/eabb7b91b36b202b4dac2df2d59d698e3aff197a
  Author: Aurelien Jarno <address@hidden>
  Date:   2016-04-21 (Thu, 21 Apr 2016)

  Changed paths:
    M tcg/aarch64/tcg-target.inc.c
    M tcg/arm/tcg-target.inc.c
    M tcg/i386/tcg-target.inc.c
    M tcg/ia64/tcg-target.inc.c
    M tcg/mips/tcg-target.inc.c
    M tcg/optimize.c
    M tcg/ppc/tcg-target.inc.c
    M tcg/s390/tcg-target.inc.c
    M tcg/sparc/tcg-target.inc.c
    M tcg/tcg.c
    M tcg/tci/tcg-target.inc.c

  Log Message:
  -----------
  tcg: use tcg_debug_assert instead of assert (fix performance regression)

The TCG code is quite performance sensitive, but at the same time can
also be quite tricky. That is why asserts that can be enabled with the
--enable-debug-tcg configure option.

This used to work the following way:

| #include "config.h"
|
| ...
|
| #if !defined(CONFIG_DEBUG_TCG) && !defined(NDEBUG)
| /* define it to suppress various consistency checks (faster) */
| #define NDEBUG
| #endif
|
| ...
|
| #include <assert.h>

Since commit 757e725b (tcg: Clean up includes) "config.h" as been
replaced by "qemu/osdep.h" which itself includes <assert.h>. As a
consequence the assertions are always enabled, even when using
--disable-debug-tcg, causing a performance regression, especially on
targets with many registers. For instance on qemu-system-ppc the
speed difference is about 15%.

tcg_debug_assert is controlled directly by CONFIG_DEBUG_TCG and already
uses in some places. This patch replaces all the calls to assert into
calss to tcg_debug_assert.

Cc: Peter Maydell <address@hidden>
Cc: Richard Henderson <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>


  Commit: 8d8fdbae010aa75a23f0307172e81034125aba6e
      
https://github.com/qemu/qemu/commit/8d8fdbae010aa75a23f0307172e81034125aba6e
  Author: Aurelien Jarno <address@hidden>
  Date:   2016-04-21 (Thu, 21 Apr 2016)

  Changed paths:
    M tcg/aarch64/tcg-target.inc.c
    M tcg/arm/tcg-target.inc.c
    M tcg/i386/tcg-target.inc.c
    M tcg/ia64/tcg-target.inc.c
    M tcg/mips/tcg-target.inc.c
    M tcg/ppc/tcg-target.inc.c
    M tcg/s390/tcg-target.inc.c
    M tcg/sparc/tcg-target.inc.c
    M tcg/tcg.c
    M tcg/tci/tcg-target.inc.c

  Log Message:
  -----------
  tcg: check for CONFIG_DEBUG_TCG instead of NDEBUG

Check for CONFIG_DEBUG_TCG instead of NDEBUG, drop now useless code.

Cc: Richard Henderson <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/b4850e5ae960...8d8fdbae010a

reply via email to

[Prev in Thread] Current Thread [Next in Thread]