Merge, from CGTUNE branch, a cleaned up version of r6742:

Another optimisation: allow tools to provide a final_tidy function
which they can use to mess with the final post-tree-built IR before it
is handed off to instruction selection.

In memcheck, use this to remove redundant calls to
MC_(helperc_value_check0_fail) et al.  Gives a 6% reduction in code
size for Memcheck on x86 and a smaller (3% ?) speedup.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6787 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/mc_include.h b/memcheck/mc_include.h
index 771056d..77440cf 100644
--- a/memcheck/mc_include.h
+++ b/memcheck/mc_include.h
@@ -320,6 +320,9 @@
                         VexGuestExtents* vge,
                         IRType gWordTy, IRType hWordTy );
 
+extern
+IRSB* MC_(final_tidy) ( IRSB* );
+
 #endif /* ndef __MC_INCLUDE_H */
 
 /*--------------------------------------------------------------------*/