This is the mail archive of the gcc@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]

Re: Why can't CSE recognize const_int's in HIGH LO_SUM pair?


> (set (reg a) (const_int ))	/* High part */
> (set (reg b) (plus (reg a) (const_int))  /* Low part */
> 
> Has the advantage of being able to share the high part across multiple
> constant loads, much like we do for symbolic references with offsets.
> 
> The only downside I see offhand is CSE knows high/lo_sum is somewhat special,
> but I would expect it to be able to grok the above sequence just as well to
> determine the constant value for (reg b).

A crack at partially implementing the above approach is here:
<http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00906.html>.  Most of
the infrastructure to implement it was already in place.

It fixes the fail of 20000731-1.c at -O1.  The one clear advantage to
this approach that I can see is that constants expressed in the above
form are recognized during jump expansion.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


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