- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use -vec-report=3 it can't report whether line 22 is vectored.
I don't know why , can you help me ?
$ icpc -vec-report=3 -o element element.c
element.c(26): (col. 2) remark: LOOP WAS VECTORIZED.
element.c(18): (col. 2) remark: LOOP WAS VECTORIZED.
element.c(9): (col. 1) remark: FUNCTION WAS VECTORIZED.
element.c(9): (col. 1) remark: FUNCTION WAS VECTORIZED.
code:
1 #include <stdio.h>
2 #include <stdlib.h>
3 int a[1000];
4 int N = 1000;
5 __declspec(noinline)
6 int checksum()
7 {
8 int i;
9 int sum = 0;
10 for(i =0; i < N; i++)
11 sum += a;
12
13 return sum;
14 }
15
16 int main()
17 {
18 for(int i =0; i < 1000; i++)
19 a = i;
20 int sum[100];
21 #pragma simd
22 for(int i =0; i< 100; i++)
23 sum = checksum();
24
25 return 0;
26 }
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you ever tried the code without 'noinline' declearation?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 (or more) reasons:
Inner loop vectorization at line 10 should be preferred (as you have implied -fp-model=fast).
In-lining, required to vectorize a function, should lead to dead code elimination.
I think they told us customers who were consulted disliked reports of dead code elimination. opt-report would be the way to see it if it were available. As it is, absence of a report is likely to indicate that.
This is the MIC forum; you didn't set any MIC compile option. Even if you did, eliminated dead code shouldn't show any value for MIC.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page