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] for ivopts problem in PR 19038


On Wed, Jan 19, 2005 at 11:01:22PM +0100, Zdenek Dvorak wrote:
> do
>   {
>     i_1 = phi (0, i_2);
>     something;
>     i_2 = i_1 + 1;
>   } while (i_1 != n)

I wonder how much benefit we'd get from 

  np1 = n + 1;
  do
    {
      i_1 = phi (0, i_2);
      something;
      i_2 = i_1 + 1;
    } while (i_2 != np1);

Given NE and unsigned or -fwrapv, of course.  I suppose it depends
on whether or not n remains live on its own, keeping n and np1 live
in registers simultaneously.

> 	* tree-ssa-loop-ivopts.c (allow_ip_end_pos_p): New function.
> 	(add_candidate): Add ivs with increment in latch only if
> 	allow_ip_end_pos_p is true.
> 	(determine_iv_cost): Use empty_block_p.

Ok.


r~


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