/* ------------ 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) {
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------------------------"
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) {