]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Change a stupid algorithm that deals with real register live
authorJulian Seward <jseward@acm.org>
Fri, 1 Dec 2006 02:59:17 +0000 (02:59 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 1 Dec 2006 02:59:17 +0000 (02:59 +0000)
commit28407df2be32c9e2f2c7ab557147d07cb9b96bda
tree240d25914bb9abfe50fb22953021879f67138496
parent54f653c0abbe48ff82980c580a9ffccdb43053fa
Change a stupid algorithm that deals with real register live
ranges into a less stupid one.  Prior to this change, the complexity
of reg-alloc included an expensive term

O(#instrs in code sequence x #real-register live ranges in code sequence)

This commit changes that term to essentially

O(#instrs in code sequence) + O(time to sort real-reg-L-R array)

On amd64 this nearly halves the cost of register allocation and means
Valgrind performs better in translation-intensive situations (a.k.a
starting programs).  Eg, firefox start/exit falls from 119 to 113
seconds.  The effect will be larger on ppc32/64 as there are more real
registers and hence real-reg live ranges to consider, and will be
smaller on x86 for the same reason.

The actual code the JIT produces should be unchanged.  This commit
merely modifies how the register allocator handles one of its
important data structures.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1686
VEX/priv/host-generic/reg_alloc2.c