On 08/07/2012 02:22 AM, Steven Bosscher wrote:
Hello,

In the test case for PR54146, build_insn_chain spends almost all its
time in this loop:

   FOR_EACH_BB_REVERSE (bb)
     {
       bitmap_iterator bi;
       rtx insn;

       CLEAR_REG_SET (live_relevant_regs);
-->   memset (live_subregs_used, 0, max_regno * sizeof (int));

The test case has >400,000 basic blocks and >1,000,000 regs...

Fortunately this can be done much more efficiently if one realizes
that an sbitmap knows its own size (using SBITMAP_SIZE that I
introduced recently). With that, live_subregs_used can be a sparse
bitmap.

Bootstrapped&tested on x86_64-unknown-linux-gnu. OK for trunk?


Ok.  Thanks for the patch, Steven.

Reply via email to