This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Speed up genattrtab
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 22 Nov 2003 23:18:21 -0800
- Subject: Re: [PATCH] Speed up genattrtab
- References: <20031122183720.GA21173@atrey.karlin.mff.cuni.cz>
Zdenek Dvorak <email@example.com> writes:
> this patch speeds up genattrtab significantly. All timings are done
> on i686 (and config/i386/i386.md, of course).
> 1) Genattrtab spends most of its time simplifying complicated logical
> expressions. The greatest bulk of them are just used to express
> sets of alternatives. By adding a special representation of them
> (EQ_ATTR_ALT), genattrtab becomes about 3 times faster! (from 103
> seconds to 36).
> I have tested that I maintain correctness and efficiency
> -- insn-attrtab.c is of course different, since sometimes we
> optimize out things that were not optimized and vice versa,
> and we do checks for membership into a set by checking
> (1 << which_alternative) & set), but the changes I have
> investigated are equivalent
> -- the produced programs are identical
> -- the compilation time is unchanged
> 2) I have also modified a few functions so that all strings are always
> replaced by canonical copies, so that string equality can be verified
> just by comparing pointers. This improves speed by another ~2% (to
> 35 seconds).
> Bootstrapped and tested on i686.
> + newexp = mk_attr_alt (1 << atoi (XSTR (exp, 1)));
I don't see the part of the patch that checks whether this can
overflow. In particular, rs6000 has 53 possible insn type attributes,
and you're using 'int'.
Could you split the second part out into a separate patch?
- Geoffrey Keating <firstname.lastname@example.org>