On 6/3/24 5:34 AM, Manolis Tsamis wrote:
This is an extension of what was done in PR106590.

Currently if a sequence generated in noce_convert_multiple_sets clobbers the
condition rtx (cc_cmp or rev_cc_cmp) then only seq1 is used afterwards
(sequences that emit the comparison itself). Since this applies only from the
next iteration it assumes that the sequences generated (in particular seq2)
doesn't clobber the condition rtx itself before using it in the if_then_else,
which is only true in specific cases (currently only register/subregister moves
are allowed).

This patch changes this so it also tests if seq2 clobbers cc_cmp/rev_cc_cmp in
the current iteration. This makes it possible to include arithmetic operations
in noce_convert_multiple_sets.

It also makes the code that checks whether the condition is used outside of the
if_then_else emitted more robust.

gcc/ChangeLog:

        * ifcvt.cc (check_for_cc_cmp_clobbers): Use modified_in_p instead.
        (noce_convert_multiple_sets_1): Don't use seq2 if it clobbers cc_cmp.
        Refactor the code that sets read_comparison.

Signed-off-by: Manolis Tsamis <manolis.tsa...@vrull.eu>
I'm assuming you've bootstrapped and regression tested on x86, aarch64 or some other primary platform. If that assumption is true, then this is fine for the trunk.

Jeff

Reply via email to