foo.c

Line Hotness Pass Source
1
// Taken from Adam Nemet's November 2016 LLVM talk
2
3
#if 0
4
void accumulate (int x, int *a)
5
{
6
  *a += x;
7
}
8
#else
9
extern void accumulate (int x, int *a);
10
#endif
11
12
int compute_sum (int arr[], int n)
13
{
14
  int sum = 0;
15
  for (int i = 0; i < n; ++i)
955630000 vect
  ^=== analyzing loop ===
    === analyze_loop_nest ===
      === vect_analyze_loop_form ===
        === get_loop_niters ===
      symbolic number of iterations is (unsigned int) n_9(D)
      not vectorized: loop contains function calls or data references that cannot be analyzed
  
118112000 slp
  ^=== vect_slp_analyze_bb ===
  
118112000 slp
  ^=== vect_slp_analyze_bb ===
    === vect_analyze_data_refs ===
      got vectype for stmt: _4 = *_3;vector(4) int
    not vectorized: not enough data-refs in basic block
    === vect_analyze_data_refs ===
    not vectorized: not enough data-refs in basic block
  
955630000 slp
  ^=== vect_slp_analyze_bb ===
  
955630000 slp
  ^=== vect_slp_analyze_bb ===
    === vect_analyze_data_refs ===
      got vectype for stmt: pretmp_24 = sum;vector(4) int
    not vectorized: not enough data-refs in basic block
  
955630000 slp
  ^=== vect_slp_analyze_bb ===
    === vect_analyze_data_refs ===
    not vectorized: not enough data-refs in basic block
  
16
    accumulate (arr[i], &sum);
17
  return sum;
18
}