> Consider the following dot-product computation:
>
> uint32_t
> tcp_checksum(int n, uint8_t* data)
> {
> uint32_t sum = 0;
> for (int i=0; i<n; i+=1)
> sum += data[i] * data[i];
> return sum;
> }
>
> At present, following vectorization and the subsequent optimization
> passes, we will end up with the following GIMPLE code:
>
> vect__1 = .MASK_LOAD (vectp_data, 8B, loop_mask_1, { 0, ... });
> masked_op1_1 = VEC_COND_EXPR <loop_mask_1, vect__1, { 0, ... }>;
> vect_patt_1 = DOT_PROD_EXPR <vect__1, masked_op1_1, vectt_sum_1>;
>
> By looking at the input data going into the VEC_COND_EXPR, its mask
> and its else value, we can walk back up the USE-DEF chain to see
> whether the source of the input data shares the same mask and else
> values. If so, we can safely remove the VEC_COND_EXPR statement from
> the cfg, thus resulting in the more optimal variant:
Can we not avoid creating the cond-expr in the first place?
--
Regards
Robin