[llvm-dev] m32 flag disables vectorization

Anastasiya Ruzhanskaya via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 7 09:16:32 PDT 2017


I have a simple loop,
#include <stdio.h>
#define N 200

int array[N];

int main() {
    int result = 0;
    int a, b, c;
    for (b = 0; b < N; b++)
        array[b] = b%3;

#pragma clang loop vectorize(enable)
    for (a = 0; a < N; a++) {
        result += array[a];

    return result;

I compile it like this:
clang -emit-llvm -m32 -c -O0 myarray2.c -o myarray2.s
opt -mem2reg -loops -loop-simplify -loop-rotate -loop-vectorize -S
myarray2.s -o opt.s

and I don't see any effect of vectorization. When I delete m32 flag,
vectorization is applied, Why does this happen?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170707/b54c15e6/attachment.html>

More information about the llvm-dev mailing list