This is the mail archive of the
mailing list for the GCC project.
Re: Speed up RTL CPROP
On Wed, 2005-02-02 at 11:26 -0500, Ian Lance Taylor wrote:
> Jeffrey A Law <email@example.com> writes:
> > The sole remaining purpose of the reg_set_table is to allow us to know
> > what blocks a particular pseudo register is set in. Rather than store
> > the insn which sets the pseudo, we can just as easily store the block
> > index of the block containing the insn which sets the pseudo. That
> > allows us to remove two memory loads from the loop.
> Don't you know have duplicate information in reg_set_table, in that a
> single basic block index may appear in the list multiple times? That
> shouldn't break anything, but is it wasteful?
> In particular, what if you make the simple optimization that
> record_one_set only adds a new entry if
> reg_set_table[regno] != NULL
> && reg_set_table[regno]->bb_index != BLOCK_NUM (insn)
> ? I would imagine that that would cut down on the number of entries
> considerably in some types of code, given that compute_sets() just
> walks down the insn chain in order.
While it can cut down on the number of entries in the chain, it's
measurably slower -- probably because it is relatively rare to have
an register that is set more than once in the same block. The
extra checks to avoid duplicate information clearly have a cost and
we'd need to avoid a lot more entries in the chain to recover the
cost of the checks.
Thanks for the suggestion though. I'm still pondering some changes in
this code -- we're still burning more time in gcse.c than I think we