On 10/19/23 13:41, Richard Sandiford wrote:
Manolis Tsamis <manolis.tsa...@vrull.eu> writes:
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.

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.

Signed-off-by: Manolis Tsamis <manolis.tsa...@vrull.eu>
---

(no changes since v1)

  gcc/ifcvt.cc | 49 +++++++++++++++++++------------------------------
  1 file changed, 19 insertions(+), 30 deletions(-)

Sorry for the slow review.  TBH I was hoping someone else would pick
it up, since (a) I'm not very familiar with this code, and (b) I don't
really agree with the way that the current code works.  I'm not sure the
current dependency checking is safe, so I'm nervous about adding even
more cases to it.  And it feels like the different ifcvt techniques are
not now well distinguished, so that they're beginning to overlap and
compete with one another.  None of that is your fault, of course. :)
I'd been hoping to get it it as well, particularly since I've got a TODO to sort out the conditional zero support in ifcvt.cc from various contibutors. While there isn't any overlap I can see between that work and this submission from Manolis, it's close enough that if I'm going to get re-familiar with ifcvt.cc I figured I'd try to handle both.


jeff

Reply via email to