[Bug fortran/31067] MINLOC should sometimes be inlined (gas_dyn is sooooo sloooow)

irar at il dot ibm dot com gcc-bugzilla@gcc.gnu.org
Mon Jul 27 12:44:00 GMT 2009



------- Comment #38 from irar at il dot ibm dot com  2009-07-27 12:44 -------
I am not sure that that kind of computation can be generated automatically,
since in general the order of caclulation of cond_expr cannot be changed. 

However, the loop can be split:

  for (i = 0; i < end; i++)
    if (arr[i] < limit)
      limit = arr[i];

  for (i = 0; i < end; i++)
    if (arr[i] == limit)
      {
        pos = i + 1;
        break;
      }

making the first loop vectorizable (inner-most loop vectorization).

Ira


-- 


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



More information about the Gcc-bugs mailing list