From 09df85393ce5501a28359d159670fd05c4d70abf Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 28 May 2020 10:27:48 +0200 Subject: tree-optimization/95273 - more vectorizable_shift massaging Covering all bases in vectorizable_shift is hard - this makes sure to appropriately handle the case of PR95356 without breaking others. 2020-05-28 Richard Biener PR tree-optimization/95273 PR tree-optimization/95356 * tree-vect-stmts.c (vectorizable_shift): Adjust when and to what we set the vector type of the shift operand SLP node again. * gcc.target/i386/pr95356.c: New testcase. --- gcc/tree-vect-stmts.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/tree-vect-stmts.c') diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 2f92bb5..ff335aa 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -5792,7 +5792,11 @@ vectorizable_shift (vec_info *vinfo, if (slp_node && (!vect_maybe_update_slp_op_vectype (slp_op0, vectype) || (!scalar_shift_arg - && !vect_maybe_update_slp_op_vectype (slp_op1, vectype)))) + && (!incompatible_op1_vectype_p + || dt[1] == vect_constant_def) + && !vect_maybe_update_slp_op_vectype + (slp_op1, + incompatible_op1_vectype_p ? vectype : op1_vectype)))) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, -- cgit v1.1