aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-predcom.cc
diff options
context:
space:
mode:
authorManolis Tsamis <manolis.tsamis@vrull.eu>2023-06-30 13:06:42 +0200
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>2024-08-12 14:57:21 +0200
commit28b3812c9d81203ae3d6a5350d8f828f4e659e50 (patch)
treed6647779834cd89a7b98a40f7f1c77f7cf050428 /gcc/tree-predcom.cc
parent68da681e614c2750f648dac2cd0b2595999ca5d9 (diff)
downloadgcc-28b3812c9d81203ae3d6a5350d8f828f4e659e50.zip
gcc-28b3812c9d81203ae3d6a5350d8f828f4e659e50.tar.gz
gcc-28b3812c9d81203ae3d6a5350d8f828f4e659e50.tar.bz2
ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets
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. It also checks whether the resulting sequence clobbers the condition attached to the jump. 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. Punt if seq clobbers cond. Refactor the code that sets read_comparison.
Diffstat (limited to 'gcc/tree-predcom.cc')
0 files changed, 0 insertions, 0 deletions