PATCH [mainline] speed up comparing enums declared in multiple translation units
Fariborz Jahanian
fjahanian@apple.com
Thu Mar 11 18:34:00 GMT 2004
On Mar 11, 2004, at 10:27 AM, Andrew Pinski wrote:
>
> On Mar 11, 2004, at 10:16, Fariborz Jahanian wrote:
>
>> I have incorporated Andrew Pinski's patch, which speeds up the case
>> where the enum type values are in
>> the same order, In this patch. Combined patch improves compile-time
>> build of mesa by additional 50%
>> (on my G5 512 Mbyte machine, build time went down from 13 minutes to
>> 6.5 min).
>> bootstrapped, dejagnu tested on PPC-darwin. OK for mainline?
>>
>> - Fariborz Jahanian (fjahanian@apple.com).
>
>
> One a little mistake:
>
> if (simple_cst_equal (TREE_VALUE (tv1), TREE_VALUE
> (tv2)) != 1)
> ! res = 0, done = 1;
>
> should really be:
>
> if (simple_cst_equal (TREE_VALUE (tv1), TREE_VALUE (tv2)) != 1)
> {
> res = 0;
> done = 1;
> break;
> }
>
> other wise you are going to do extra work when the two enums are not
> equivalent.
Yes, thanks.
>
> Also:
> ! int res;
> ! int done;
>
> These most likely should be bool instead and should use true/false
> instead of 0 and 1.
res is return value for tagged_types_tu_compatible_p which is an 'int'.
I followed gcc's convention
which seems to use 'int' in place of bool in other places. But I don't
have a strong feel for this.
- Thanks, fariborz
>
>
> Thanks,
> Andrew Pinski
>
More information about the Gcc-patches
mailing list