[llvm-commits] [llvm] r170503 - in /llvm/trunk/docs: Vectorizers.rst subsystems.rst

Shuxin Yang shuxin.llvm at gmail.com
Wed Dec 19 00:36:52 PST 2012


Hi, Nadav:

   I guess we are bit conservative in this case.

+
+  void bar(float *A, float* B, float K, int start, int end) {
+   for (int i = start; i < end; ++i)
+     A[i] *= B[i] + K;
+  }
+
   Let us use a simpler case:

   void foo(float *P, float *Q) {
      for (i = 0; i < symbolic-val; i++)
        P[i] += Q[i];
   }

   We don't need examine if P[*] overlap Q[*]. I guess condition
"Q <= P || (Q - P) >= Vector-length" is enough. The reasoning is following:

   Break the statement in questions into following simpler stmts:

   S1: t1 = Q[i]
   S2: t2 = P[i]
   S3: P[i] = t1 + t2

There are bunch of dep here. We only care if the dependences form a SCC.
SCC could exist only if there is a dep from S3 to S1 arising from mem-access.

So if Q <= P, there is mem-flow-dep at all.
if Q - P = m (m> 0), there is mem-flow-dep between S3 and S1; however, if
m >= vector-length, we can still go ahead vectorize in the presence of SCC.


   
    
  






More information about the llvm-commits mailing list