https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85186
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2018-04-04 CC| |law at gcc dot gnu.org, | |rguenth at gcc dot gnu.org Blocks| |53947 Summary|ifcvt can peel iterations |jump threading can rotate |affecting code form, and |loops affecting loop form, |causing vectorization not |and causing vectorization |to happen |not to happen Ever confirmed|0 |1 --- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- It's not if-conversion but jump threading doing this. If you specify -fno-tree-dominator-opts you get back the vectorization. Likely a regression from the time DOM gained the ability to CSE A[0] = 36 across unrelated stores. It's also not affecting code form but the number of iterations which on x86 is then too small to be vectorized. Not sure how we can identify good/bad jump threadings... in this case it rotates the loop into non-canonical (not loop header copied) form and the loop header copying pass before the vectorizer completes the peeling then to give it a chance to be vectorized. I guess DOM needs a cost model to determine when loop rotation is profitable. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947 [Bug 53947] [meta-bug] vectorizer missed-optimizations