"Single Compilation Unit" trick disturbs optimizations

"Single Compilation Unit" trick disturbs optimizations

I'm trying the "Single Compilation Unit" trick (see http://www.gamesfromwithin.com/articles/0403/000013.htmlfor details) consisting in compiling a single file 'everything.cpp' file wich #include's all source files in the project.

I was expecting to manually obtain kind of a portable /Qipo switch, and also reduced compilation times.

Results:
- reduced compilation time (1/3 approx) as expected
- increased execution time (x2 approx) unexpected!
- halved dll size (unexpected!)
- reduced output from vectorizer and autoCPU dispatch (1/10 'remark' lines)

Conclusion: this hack is messing up with the optimization phases.

any help with this issue? maybe some internal compiler limit reached?

Intel C++ Compiler for 32-bit applications, Version 9.0 Build 20050430Z Package ID: W_CC_P_9.0.019

Options: /QaxWNP /O3 /Qipo

Project: ~100 .cpp files, total ~32KLOC

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Dear darietti7,

When functions are inlined, vectorization diagnostics are reported at the caller (and possibly still at the callee when the function is preserved). Hence, differences in inlining can substantially impact vectorization diagnostics, which does not always mean something went wrong. Can you please investigate the differences using Qvec_report2 to see if important loops no longer vectorize, or if they are skipped altogether?

Aart Bik
http://www.aartbik.com/

Leave a Comment

Please sign in to add a comment. Not a member? Join today