Tyler Nowicki | 8a0925c | 2015-08-10 19:56:40 +0000 | [diff] [blame^] | 1 | // RUN: %clang -O1 -fvectorize -Rpass-analysis=loop-vectorize -emit-llvm -S %s -o - 2>&1 | FileCheck %s |
| 2 | |
| 3 | // CHECK: {{.*}}:9:11: remark: loop not vectorized: vectorization requires changes in the order of operations, however IEEE 754 floating-point operations are not commutative; allow commutativity by specifying ‘#pragma clang loop vectorize(enable)’ before the loop or by providing the compiler option ‘-ffast-math’ |
| 4 | |
| 5 | double foo(int N) { |
| 6 | double v = 0.0; |
| 7 | |
| 8 | for (int i = 0; i < N; i++) |
| 9 | v = v + 1.0; |
| 10 | |
| 11 | return v; |
| 12 | } |