PATCH for CSE speedup

Jeffrey A Law law@upchuck.cygnus.com
Sun Mar 28 22:53:00 GMT 1999


  In message < 199903290643.WAA31158@adsl-206-170-148-33.dsl.pacbell.net >you wri
te:
  > 
  > This patch reduces the CSE time for one 100K-register function on my
  > PPro from 518 seconds to 16 seconds (a 32X speedup).
  > 
  > The culprit was the large reg_tick, reg_in_table, and reg_qty arrays
  > which were reinitialized at the start of each basic block, making the
  > algorithm dependent on the total number of registers in the function,
  > rather than the number in any particular basic block.  I replaced the
  > arrays with splay-trees, retaining quick lookup but reducing
  > initialization cost.  As a bonus, we also reduce memory usage, which
  > in this case, was roughly half a megabyte of alloca'd storage.
Very cool!  For those folks who aren't aware, cse is one of the slowest parts
of the compiler -- worse yet, it runs twice.  So any speedups we make to cse
pay us back double.

I'll try to take a good look at this tomorrow.  I've also got some codes which
compile horribly slowly due to cse1/cse2 that I'll try with the new code :-)

jeff


More information about the Gcc-patches mailing list