u/pron98in r/programming • Recommends
On “Why is “2 * (i * i)” faster than “2 * i * i”? (JAVA)”
HotSpot's C2 compiler actually does vectorize loops, but not in this particular case of a sequential reduction, where the optimization was specifically disabled, as it was deemed not beneficial enough; re-enabling it is an open issue. See this talk for a comparison of C2 and clang optimizations.