Add logic to allow front ends to speculatively continue adding guest
instructions into IRSBs (superblocks) after conditional branches.
Currently only the x86 and amd64 front ends support this.  The
assumption is that backwards conditional branches are taken and
forwards conditional branches are not taken, which is generally
regarded as plausible and is particularly effective with code compiled
by gcc at -O2, -O3 or -O -freorder-blocks (-freorder-blocks is enabled
by default at -O2 and above).

Is disabled by default.  Has been seen to provide notable speedups
(eg, --tool=none for perf/bz2), and reduces the number of
block-to-block transitions dramatically, by up to half, but usually
makes programs run more slowly.  Increases the amount of generated
code by at least 15%-20% and so is a net liability in terms of icache
misses and JIT time.



git-svn-id: svn://svn.valgrind.org/vex/trunk@1957 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/guest_generic_bb_to_IR.h b/priv/guest_generic_bb_to_IR.h
index 148346a..1aa1ef8 100644
--- a/priv/guest_generic_bb_to_IR.h
+++ b/priv/guest_generic_bb_to_IR.h
@@ -79,9 +79,13 @@
       /* What happens next?
          Dis_StopHere:  this insn terminates the BB; we must stop.
          Dis_Continue:  we can optionally continue into the next insn
-         Dis_Resteer:   followed a branch; continue at the spec'd addr
+         Dis_ResteerU:  followed an unconditional branch; continue at 
+                        'continueAt'
+         Dis_ResteerC:  (speculatively, of course) followed a
+                        conditional branch; continue at 'continueAt'
       */
-      enum { Dis_StopHere, Dis_Continue, Dis_Resteer } whatNext;
+      enum { Dis_StopHere, Dis_Continue, 
+             Dis_ResteerU, Dis_ResteerC } whatNext;
 
       /* For Dis_Resteer, this is the guest address we should continue
          at.  Otherwise ignored (should be zero). */
@@ -123,9 +127,16 @@
          or not? */
       /*IN*/  Bool         put_IP,
 
-      /* Return True iff resteering to the given addr is allowed */
+      /* Return True iff resteering to the given addr is allowed (for
+         branches/calls to destinations that are known at JIT-time) */
       /*IN*/  Bool         (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
 
+      /* Should we speculatively resteer across conditional branches?
+         (Experimental and not enabled by default).  The strategy is
+         to assume that backward branches are taken and forward
+         branches are not taken. */
+      /*IN*/  Bool         resteerCisOk,
+
       /* Vex-opaque data passed to all caller (valgrind) supplied
          callbacks. */
       /*IN*/  void*        callback_opaque,