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] |
On Fri, 26 Dec 2003, Dorit Naishlos wrote: > > > > > Hi, > > Here is the first implementation of a basic loop vectorizer, as described > in http://gcc.gnu.org/projects/tree-ssa/vectorization.html. A real patch > will follow shortly - this one is relative to an old tree-ssa snapshot and > also includes bits from an old version of Sebastian's IV evolution > analyzer. But I think it's in a shape that allows people to start to take a > look and comment (please do!). > > A few comments/questions: > As I described in http://gcc.gnu.org/ml/gcc/2003-12/msg00908.html, memory > references are vectorized using a pointer to vector type which is used to > point to the accessed array; e.g., the following scalar code: > (1a) int a[N] = {0,1,2,3}; > (2a) for (i...) {int x = a[i]; ...} #VUSE a_1 > becomes: > (1b) int a[N] = {0,1,2,3} > (2b) v4si *ptr = (v4si *)a; > (3b) for (i...) {v4si vx = *(ptr + 16 * i); ...} > Unfortunately, due to the aliasing semantics in gcc, the compiler marks > reads/writes via 'ptr' as referencing a different alias set than the > reads/writes via 'a[i]' (because they have different types). Therefore, > unless I use -fno-strict-aliasing, the resulting code does not run > correctly (in the example above, the load in (3b) is hoisted before the > stores that initialize array 'a'...). How do I force '*ptr' references into > the same alias set as 'a[i]' references? Using unions. THe above violates C aliasing rules (you are casting int * to v4si *), AFAIK.
Attachment:
vect_patch
Description: Binary data
Attachment:
tree-vectorizer_h
Description: Binary data
Attachment:
tree-vectorizer_c
Description: Binary data
Attachment:
vec_test_SF_c
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |