|
From: <sv...@va...> - 2016-08-05 15:02:55
|
Author: sewardj
Date: Fri Aug 5 16:02:48 2016
New Revision: 3239
Log:
Reduce the number of IR sanity checks from 4 per block to 2 per block.
Also relax assertion checking in the register allocator.
Together with valgrind r15927 this reduces per-block JITting cost by 10%-15%.
Modified:
trunk/priv/host_generic_reg_alloc2.c
trunk/priv/main_main.c
Modified: trunk/priv/host_generic_reg_alloc2.c
==============================================================================
--- trunk/priv/host_generic_reg_alloc2.c (original)
+++ trunk/priv/host_generic_reg_alloc2.c Fri Aug 5 16:02:48 2016
@@ -993,13 +993,13 @@
/* ------------ Sanity checks ------------ */
/* Sanity checks are expensive. So they are done only once
- every 13 instructions, and just before the last
+ every 17 instructions, and just before the last
instruction. */
do_sanity_check
= toBool(
False /* Set to True for sanity checking of all insns. */
|| ii == instrs_in->arr_used-1
- || (ii > 0 && (ii % 13) == 0)
+ || (ii > 0 && (ii % 17) == 0)
);
if (do_sanity_check) {
Modified: trunk/priv/main_main.c
==============================================================================
--- trunk/priv/main_main.c (original)
+++ trunk/priv/main_main.c Fri Aug 5 16:02:48 2016
@@ -916,8 +916,13 @@
irsb = do_iropt_BB ( irsb, specHelper, preciseMemExnsFn, pxControl,
vta->guest_bytes_addr,
vta->arch_guest );
- sanityCheckIRSB( irsb, "after initial iropt",
- True/*must be flat*/, guest_word_type );
+
+ // JRS 2016 Aug 03: Sanity checking is expensive, we already checked
+ // the output of the front end, and iropt never screws up the IR by
+ // itself, unless it is being hacked on. So remove this post-iropt
+ // check in "production" use.
+ // sanityCheckIRSB( irsb, "after initial iropt",
+ // True/*must be flat*/, guest_word_type );
if (vex_traceflags & VEX_TRACE_OPT1) {
vex_printf("\n------------------------"
@@ -953,9 +958,12 @@
vex_printf("\n");
}
- if (vta->instrument1 || vta->instrument2)
- sanityCheckIRSB( irsb, "after instrumentation",
- True/*must be flat*/, guest_word_type );
+ // JRS 2016 Aug 03: as above, this never actually fails in practice.
+ // And we'll sanity check anyway after the post-instrumentation
+ // cleanup pass. So skip this check in "production" use.
+ // if (vta->instrument1 || vta->instrument2)
+ // sanityCheckIRSB( irsb, "after instrumentation",
+ // True/*must be flat*/, guest_word_type );
/* Do a post-instrumentation cleanup pass. */
if (vta->instrument1 || vta->instrument2) {
|