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] Speedup by 3.5% by overhauling rtx classes


> -  if (GET_RTX_CLASS (GET_CODE (cond1)) == '<'
> -      && GET_RTX_CLASS (GET_CODE (cond2)) == '<'
> +  if (COMPARISON_P (cond1)
> +      && COMPARISON_P (cond1)
>
> Typo.  cond1 => cond2

Good catch.

> -     if (*p == 0 && *q == 0 && GET_RTX_CLASS(op) == '<')
> +     if (*p == 0 && *q == 0
> + && (GET_RTX_CLASS (op) == RTX_COMPARE
> +     || GET_RTX_CLASS (op) == RTX_COMM_COMPARE))
>
> GET_RTX_CLASS(op) & RTX_COMPARE_MASK == RTX_COMPARE_RESULT would be better
> here and a few other places.

I did that always except here and in genattrtab.  It's not hot code.

> Maybe a COMPARISON_CODE_P(code) macro is
> needed?  I'd recommend pulling out the GET_CODE(X) calls from the _P macros
> and putting them back in the callers, so that you have a single set of
> macros.  It would make the changes less invasive looking as well, and give
> you some opportunities to skip the GET_CODE calls.

Actually that is on purpose, because GCSE should take care of removing the
GET_CODE calls if they are already available (and indeed it does), and the
code is much less cluttered this way (despite adding 100 lines of code, the
patch shortens the source code by 10 bytes :-)).

Paolo




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