On Mon, 3 Sep 2012, Richard Guenther wrote:
You shouldn't need the VECTOR_CST handling - constant propagation should
already ensure properly simplified code here (and is the more canonical place
to handle this).
IIRC, I added VECTOR_CST because of mixed constructor/vector_cst shuffles
(and because it wasn't too hard). If I remove it (I can), I guess some of
the testcases won't work anymore.
You do work above and then bail late here. Always do early exists early
to reduce useless compile-time.
Ok.
+ opt = fold_ternary (VEC_PERM_EXPR, TREE_TYPE(op0), arg0, arg1, op2);
+ if (!opt)
+ return 0;
+ gimple_assign_set_rhs_from_tree (gsi, opt);
You need to verify that fold_ternary returns something that is valid GIMPLE.
fold () in general happily returns trees that are in the need of
re-gimplification.
You expect a CONSTRUCTOR or VECTOR_CST here, so you should check
for that.
Ok.
Thank you for the reviews,
--
Marc Glisse