This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Speed up genattrtab

Zdenek Dvorak <> writes:

> Hello,
> this patch speeds up genattrtab significantly. All timings are done
> on i686 (and config/i386/, 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 <>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]