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]

[PATCH]: Fix bug preventing some LICM in PRE


Steven Bosscher noticed a bug related to PRE where we were marking uses in conditionals (and other types of don't care statements) as generating things in the TMP_GEN set.
This is not correct, only DEFs go in TMP_GEN.
This genreally showed up as our inability to perform loop invariant motion on some things when there were conditionals with them as part of loop tests, etc.


Fix + testcase attached.

The vect.exp change is because this patch will cause vect-8[6-8].c to fail due to the particular code it wants to see vectorized (k = i + n in the below example)

 for (i = 0; i < n; i++)
    {
      for (j = 0; j < n; j++)
        {
          k = i + n;
          a[j] = k;
        }
      b[i] = k;
    }

is completely loop invariant out of both loops, and the fixed PRE will happily move it.

I've simply added -fno-tree-pre to the default flags for the vectorizer tests for now, since this is supposed to be testing vectorization, not general optimization. This will let vectorizer people test that we vectorize whatever they like.

It has been bootstrapped and regtestested on x86_64, ia64-linux, and i686-pc-linux-gnu, with no regressions (thanks to steven for submitting it to SuSE's autotesters).

Committed to mainline.

--Dan

Attachment: cleandiff.diff
Description: Text document


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