On 29/07/2022 16:59, Jakub Jelinek wrote: > Doing the fold_convert seems to be a wasted effort to me. > Can't this be done conditional on whether some change is needed at all > and just using gimple_build_assign with NOP_EXPR, so something like: I'm just not familiar enough with this stuff to run fold_convert in my head with confidence. > tree shift_cvt_conv = shift_cnt; > if (!useless_type_conversion_p (TREE_TYPE (mask), > TREE_TYPE (shift_cnt))) > { > shift_cnt_conv = make_ssa_name (TREE_TYPE (mask)); > g = gimple_build_assign (shift_cnt_conv, NOP_EXPR, shift_cnt); > gsi_insert_after (&gsi, g, GSI_CONTINUE_LINKING); > } > Your version gives the same output mine does, at least on amdgcn anyway. Am I OK to commit this version? Andrew