<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - major vectorizer performance regression from 3.7.1"
   href="https://llvm.org/bugs/show_bug.cgi?id=27008">27008</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>major vectorizer performance regression from 3.7.1
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.8
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>pdknsk@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>clang version 3.7.1 (tags/RELEASE_371/final)
Target: x86_64-unknown-linux-gnu

$ clang-3.7 -march=haswell -O2 -std=c99 file.c -o file
$ ./file
1048575999 0.340

clang version 3.8.0 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu

$ clang-3.8 -march=haswell -O2 -std=c99 file.c -o file
$ ./file
1048575999 0.986

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int function(const char* mem, const int x) {
    int r = 0;
    for (unsigned int i = 1; i < x; i++)
        r += (mem[i - 1] != mem[i]);
    return r;
}

int main() {
    int x = 1000 << 20;
    char* mem = (char*)malloc(x);
    for (int y = 0; y < x; y++)
        mem[y] = y & 1;
    int c = clock();
    int r = function(mem, x);
    printf("%i %.3f\n", r, (float)(clock() - c) / CLOCKS_PER_SEC);    
}</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>