------- Additional Comments From rakdver at gcc dot gnu dot org  2005-05-10 
22:28 -------
Actually, ivopts do not produce any "unresolvable overlapping live ranges".
It does not change life range of j_8 at all, and only replaces the variable
i by more suitable strength reduced version ivtmp.6.  Note that immediately
after ivopts, ivtmp.6_2 and ivtmp.6_1 can be coalesced.

Some later pass renames all the references to ivtmp.6 to j, thus creating the
overlapping life ranges.

The loop may become one of the following three possibilities:

a)

x = 5;
while (1)
  {
    j = x;
    bar (j);

    x = x + 3;
    if (...)
      break;
  }

return j;

or

b)

x = 5;
while (1)
  {
    bar (x);

    x1 = x + 3;
    if (...)
      break;
    x = x1;
  }
return x;

or

c)

x = 5;
while (1)
  {
    bar (x);

    if (...)
      break;
    x = x + 3;
  }
return x;

a) is the one chosen by ivopts.
b) is the one some copy propagation pass converts it to later.
c) is not used by ivopts in order to prevent creation of loops with multiple
   basic blocks (see PR 19038).  It would be possible to teach ivopts to handle
   this special case, but I don't think c) is that much better than a) (one more
   assignment inside the loop body, but a) is easier to schedule).

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21488

Reply via email to