This is the mail archive of the gcc-patches@gcc.gnu.org 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 [mainline] speed up comparing enums declared in multiple translation units



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.

Also:
! 	int res;
! 	int done;

These most likely should be bool instead and should use true/false instead of 0 and 1.


Thanks, Andrew Pinski


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