4 ms·
> Even more useful would be compiler-level feedback of how to stay within the constraints needed to auto-vectorize your C/C++ for loop. (I need to make this dat
by wyldfire 10y ago
> Even more useful would be compiler-level feedback of how to stay within the constraints needed to auto-vectorize your C/C++ for loop. (I need to make this data access const etc)
Specifically for clang you can use the new opt-viewer [1] to annotate the source to find hints on what could/couldn't be optimized/vectorized. Requires compiler flags only found in 4.x/trunk, unfortunately.
[1] https://github.com/llvm-mirror/llvm/tree/master/utils/opt-viewer https://github.com/llvm-mirror/llvm/tree/master/utils/opt-vi...
- hackcrafter 10y agoThat's really neat, is there any documentation/use-case examples for this outside the source code?
- wyldfire 10y agoIt was presented at the dev conf but I don't think the slides or video are up yet. :( I've used it with CPython by adding `CFLAGS="-fsave-optimization-record -fdiagnostics-show-hotness"` to the env for `./configure`. Then run opt-viewer like so: ./opt-viewer.py $(find build/ -name '*.yaml') -source-dir src/ output/ If that's not clear I can whip up a quick demonstration project.