Hi! On Wed, Nov 29, 2023 at 02:20:03PM +0100, Uros Bizjak wrote: > On Wed, Nov 29, 2023 at 1:25 PM Richard Biener > <richard.guent...@gmail.com> wrote: > > On Wed, Nov 29, 2023 at 10:35 AM Uros Bizjak <ubiz...@gmail.com> wrote: > I was assuming that if the CC reg is not used inside the comparison, > then the mode of CC reg is irrelevant. We can still combine the > instructions into new insn, without updating the use of CC reg.
It should never happen that the CC reg is not used, so what does this mean? Where it is used might not be a comparison of course, as in your example. > && (cc_use_loc = find_single_use (SET_DEST (newpat), i3, > &cc_use_insn))) > { > - compare_code = orig_compare_code = GET_CODE (*cc_use_loc); > - if (is_a <scalar_int_mode> (GET_MODE (i2dest), &mode)) > - compare_code = simplify_compare_const (compare_code, mode, > - &op0, &op1); > - target_canonicalize_comparison (&compare_code, &op0, &op1, 1); > + if (COMPARISON_P (*cc_use_loc)) > + { > + compare_code = orig_compare_code = GET_CODE (*cc_use_loc); > + if (is_a <scalar_int_mode> (GET_MODE (i2dest), &mode)) > + compare_code = simplify_compare_const (compare_code, mode, > + &op0, &op1); > + target_canonicalize_comparison (&compare_code, &op0, &op1, 1); > + } > + else > + { > + if (dump_file && (dump_flags & TDF_DETAILS)) > + fprintf (dump_file, "CC register not used in comparison.\n"); "Where the CCmode register is used is not a comparison". But more compact if you can manage (I cannot). Segher