https://llvm.org/bugs/show_bug.cgi?id=27008

            Bug ID: 27008
           Summary: major vectorizer performance regression from 3.7.1
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: pdk...@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

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);    
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to