The recent change to vect_synth_mult_by_constant missed to handle
the synth_shift_p case for alg_shift, so we still changed c * 4
to c + c + c + c. The following also amends alg_add_t2_m, alg_sub_t2_m,
alg_add_factor and alg_sub_factor appropriately.
PR tree-optimization/121753
* tree-vect-patterns.cc (vect_synth_mult_by_constant): Properly
bail when synth_shift_p and an alg_shift use. Handle other
problematic cases.
case alg_add_t2_m:
case alg_sub_t2_m:
op_uses++;
+ /* Fallthru. */
+ case alg_shift:
+ if (synth_shift_p && alg.log[i])
+ return NULL;
break;
+ case alg_add_factor:
+ case alg_sub_factor:
+ return NULL;
default:
break;
}