@Charles:Great, that blog was exactly what I was looking for! Now if only an almighty moderator could add a link to this blog as a "see also" in the video description so that other curious minds that have had their interest piqued can dig deeper, that would be wonderful
I find the title misleading. I was expecting some tips on how to write code in order to increase the likelihood of the compiler vectorizing a loop. Furthermore, I am left with the following questions:
- Does the array size need to be known at compile time?
- Do you need to use the index syntax (array[i]) or can you use pointers? What about iterators?
- Can the compiler vectorize operations on a std::vector<> ?
- Are there any operations that will prevent the compiler from vectorizing? ex. branching, trigonometry functions etc.
- If the compiler detects a cross-iteration dependency on one of the many operations in a loop, will it split the work in one vectorized loop and one scalar loop?