diff options
author | Alina Sbirlea <asbirlea@google.com> | 2019-05-23 18:51:02 +0000 |
---|---|---|
committer | Alina Sbirlea <asbirlea@google.com> | 2019-05-23 18:51:02 +0000 |
commit | 267ac925fb4ed2dad94177807d9a38ba83f2f4f0 (patch) | |
tree | ec73ae04ec6e0fce2bfe49f356f9ff6613723c6d /clang/test/CodeGen/loop-vectorize.c | |
parent | 3249be1e03c672ffe68f5ad8e0e31cdcb8e441f8 (diff) | |
download | bcm5719-llvm-267ac925fb4ed2dad94177807d9a38ba83f2f4f0.tar.gz bcm5719-llvm-267ac925fb4ed2dad94177807d9a38ba83f2f4f0.zip |
[NewPassManager] Add tuning option: SLPVectorization [clang-change]
Summary:
NewPassManager is not using CodeGenOpts values before this patch.
[to be coupled with D61616]
Reviewers: chandlerc
Subscribers: jlebar, cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61617
llvm-svn: 361534
Diffstat (limited to 'clang/test/CodeGen/loop-vectorize.c')
-rw-r--r-- | clang/test/CodeGen/loop-vectorize.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/CodeGen/loop-vectorize.c b/clang/test/CodeGen/loop-vectorize.c new file mode 100644 index 00000000000..28bd50bbd2e --- /dev/null +++ b/clang/test/CodeGen/loop-vectorize.c @@ -0,0 +1,25 @@ +// RUN: %clang -target x86_64 -S -c -O1 -fvectorize -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-ENABLE-VECT +// RUN: %clang -target x86_64 -S -c -O1 -fno-vectorize -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-DISABLE-VECT +// RUN: %clang -target x86_64 -fexperimental-new-pass-manager -S -c -O1 -fvectorize -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-ENABLE-VECT +// RUN: %clang -target x86_64 -fexperimental-new-pass-manager -S -c -O1 -fno-vectorize -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-DISABLE-VECT + +// CHECK-ENABLE-VECT-LABEL: @for_test() +// CHECK-ENABLE-VECT: fmul <{{[0-9]+}} x double> + +// CHECK-DISABLE-VECT-LABEL: @for_test() +// CHECK-DISABLE-VECT: fmul double +// CHECK-DISABLE-VECT-NOT: fmul <{{[0-9]+}} x double> + +#include <stdio.h> + +void for_test() { + double A[1000], B[1000]; + int L = 500; + for (int i = 0; i < L; i++) { + A[i] = i; + } + for (int i = 0; i < L; i++) { + B[i] = A[i]*5; + } + printf("%lf %lf\n", A[0], B[0]); +} |