https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91166
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2019-07-15 Component|tree-optimization |middle-end Version|unknown |10.0 Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- _4 = VEC_PERM_EXPR <{ 0, ... }, { 0, ... }, { 0, POLY_INT_CST [2, 2], 1, POLY_INT_CST [3, 2], 2, POLY_INT_CST [4, 2], ... }>; _35 = VEC_PERM_EXPR <_4, _4, { 0, 0, 1, 1, 2, 2, ... }>; _14 = VEC_PERM_EXPR <_4, _4, { POLY_INT_CST [1, 1], POLY_INT_CST [1, 1], POLY_INT_CST [2, 1], POLY_INT_CST [2, 1], POLY_INT_CST [3, 1], POLY_INT_CST [3, 1], ... }>; I guess? Note the vectorizer shouldn't generate unfolded permutes. Note even forwprop doesn't do anything to the above. I somehow expected that two the permute with two uniform same vectors would be constant folded indeed, but somehow _4 = VEC_PERM_EXPR <{ 0, ... }, { 0, ... }, { 0, POLY_INT_CST [2, 2], 1, POLY_INT_CST [3, 2], 2, POLY_INT_CST [4, 2], ... }>; isn't folded. It should work even for (some) non-uniform vectors to permute, no?