Skip to content

Instantly share code, notes, and snippets.

@goyalankit
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goyalankit/9726758 to your computer and use it in GitHub Desktop.
Save goyalankit/9726758 to your computer and use it in GitHub Desktop.

Notes:

All optimization reports were obtained using `icc -opt-report 3` 
with the default optimization level(2).

Case 1

for (i = 0; i < 10; i++) {
  c[i] = a[i] + b[i];
  a[i] = c[i] + b[i];
}

With instrumentation

  • method being instrumented is inlined.
  • instrumentation methods are being inlined to multiple levels.
  • loop was not vectorized: nonstandard loop is not a vectorization candidate
  • Forward substitution happened here. Probably in instrumentation functions.

Without instrumentation

  • Loop was vectorized.
  • No forward substitution
  • Modification and Reference Analysis is different.

Conclusions:

  • Optimizations Inhibited: Vectorization
  • MOD-REF Analysis(Different) -> Interprocedural Analysis

Case 2:

for (i = 0; i < 10; i++) {
  c[i] = (a[i] + b[i]);
}

loop was not vectorized: nonstandard loop is not a vectorization candidate. Instrumentation methods are getting inlined.

Optimizations Inhibited: Vectorization. MODREF analysis is different.


case 3

for(int i=0; i<n; ++i)
  a[i] = b[0];

No vectorization in either case.

MODREF analysis different

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment