title: how can I get clang to vectorize a simple loop?
body: <p>I have the following loop:</p>
  
  <pre><code>float* s;
  float* ap;
  float* bp;
  
  ... // initialize s, ap, bp
  
  for(size_t i=0;i&lt;64;++i) {
     s[i] = ap[i]+bp[i];
  }
  </code></pre>
  
  <p>Seems like a good candidate for vectorization. Though I have optimization turned on, when I look at the assembly output, clang (I'm using Xcode) seems to not have vectorized the loop:</p>
  
  <pre><code>LBB33_1:                                ## =&gt;This Inner Loop Header: Depth=1
      movss   (%rax,%rsi,4), %xmm0    ## xmm0 = mem[0],zero,zero,zero
      addss   (%rcx,%rsi,4), %xmm0
      movss   %xmm0, (%rdx,%rsi,4)
  Ltmp353:
      incq    %rsi
  Ltmp354:
      cmpq    $64, %rsi
  Ltmp355:
      jne LBB33_1
  </code></pre>
  
  <p><strong>How can I get clang/Xcode to vectorize this simple loop?</strong></p>