4 ms·
It would be so incredibly nice to have a compiler that told you about such things gcc can output such information for autovectorization (-ftree-vectorizer-verb
by danieldk 12y ago
It would be so incredibly nice to have a compiler that told you about such things
gcc can output such information for autovectorization (-ftree-vectorizer-verbose=[n])
- krylon 12y agoThat is good to know. But while for some tasks this may be crucial, vectorization is only a part of the arsenal of optimizations gcc may apply. Recently, there was discussion here on HN about C compilers (gcc, clang) exploiting undefined behaviour for optimizations that could be ... surprising. That, too, would be nice to know about. The general idea of a dialogue between a programmer and a compiler about how (and where) to optimize a program is very intriguing.
- astrange 12y agogcc and clang can output before/after output for all their passes. Try '-fdump-ipa-all -fdump-tree-all -fdump-rtl-all-slim' on gcc, I forget the llvm options. It's not especially readable, though. Also, for ghc you can use '-v5' and the option that writes out C output. Prepare to be impressed(?) at how much it doesn't look like a fast C program.