Change the way INCEIP is done.  Instead of emitting add insns, keep
track of the current %EIP value and write it to memory at an INCEIP.
Uses JeremyF's idea of only writing the lowest 8 bits if the upper 24
are unchanged since the previous write.  [might this cause probls
to do with write combining on high-performance CPUs?  To be checked
out.]

On a simple program running a small inner loop, this gets about 2/3
the benefits of removing INCEIPs altogether, compared with the add-insn
scheme.

I tried a much more complex scheme too, in which we do analysis to
remove as many INCEIPs as possible if it is possible to show that
there will be no EIP reads in between them.  This seemed to make
almost no improvement on real programs (kate, xedit) and adds some
code and slows down the code generator, so I don't think it's worth
the hassle.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1343 a5019735-40e9-0310-863c-91ae7b9d1cf9
2 files changed