]> granicus.if.org Git - clang/commitdiff
[ValueTracking] Enabling ValueTracking patch by default (recommit). Part 1.
authorNikolai Bozhenov <nikolai.bozhenov@intel.com>
Thu, 10 Aug 2017 11:22:52 +0000 (11:22 +0000)
committerNikolai Bozhenov <nikolai.bozhenov@intel.com>
Thu, 10 Aug 2017 11:22:52 +0000 (11:22 +0000)
The original patch was an improvement to IR ValueTracking on non-negative
integers. It has been checked in to trunk (D18777, r284022). But was disabled by
default due to performance regressions.
Perf impact has improved. The patch would be enabled by default.

Reviewers: reames, hfinkel

Differential Revision: https://reviews.llvm.org/D34101

Patch by: Olga Chupina <olga.chupina@intel.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310582 91177308-0d34-0410-b5e6-96231b3b80d8

test/Frontend/optimization-remark-options.c

index a2d717a2422df2d726497c4ce43e2849fac163d0..38dbbfbaccec0c1218ed2f42709b1c51840ffeb3 100644 (file)
@@ -14,7 +14,7 @@ double foo(int N) {
 // CHECK: {{.*}}:17:3: remark: loop not vectorized: cannot prove it is safe to reorder memory operations; allow reordering by specifying '#pragma clang loop vectorize(enable)' before the loop. If the arrays will always be independent specify '#pragma clang loop vectorize(assume_safety)' before the loop or provide the '__restrict__' qualifier with the independent array arguments. Erroneous results will occur if these options are incorrectly applied!
 
 void foo2(int *dw, int *uw, int *A, int *B, int *C, int *D, int N) {
-  for (int i = 0; i < N; i++) {
+  for (long i = 0; i < N; i++) {
     dw[i] = A[i] + B[i - 1] + C[i - 2] + D[i - 3];
     uw[i] = A[i] + B[i + 1] + C[i + 2] + D[i + 3];
   }