]> git.ipfire.org Git - thirdparty/gcc.git/commit
ifcvt: Handle multiple rewired regs and refactor noce_convert_multiple_sets
authorManolis Tsamis <manolis.tsamis@vrull.eu>
Tue, 29 Aug 2023 09:47:39 +0000 (11:47 +0200)
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>
Mon, 12 Aug 2024 12:57:22 +0000 (14:57 +0200)
commitb219cbeda72d23b7ad6ff12cd159784b7ef00667
treed4df405d34ee4d44a9cae1833ab4ac021a3e8775
parent72c9b5f438f22cca493b4e2a8a2a31ff61bf1477
ifcvt: Handle multiple rewired regs and refactor noce_convert_multiple_sets

The existing implementation of need_cmov_or_rewire and
noce_convert_multiple_sets_1 assumes that sets are either REG or SUBREG.
This commit enchances them so they can handle/rewire arbitrary set statements.

To do that a new helper struct noce_multiple_sets_info is introduced which is
used by noce_convert_multiple_sets and its helper functions. This results in
cleaner function signatures, improved efficientcy (a number of vecs and hash
set/map are replaced with a single vec of struct) and simplicity.

gcc/ChangeLog:

* ifcvt.cc (need_cmov_or_rewire): Renamed init_noce_multiple_sets_info.
(init_noce_multiple_sets_info): Initialize noce_multiple_sets_info.
(noce_convert_multiple_sets_1): Use noce_multiple_sets_info and handle
rewiring of multiple registers.
(noce_convert_multiple_sets): Updated to use noce_multiple_sets_info.
* ifcvt.h (struct noce_multiple_sets_info): Introduce new struct
noce_multiple_sets_info to store info for noce_convert_multiple_sets.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/ifcvt_multiple_sets_rewire.c: New test.
gcc/ifcvt.cc
gcc/ifcvt.h
gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_rewire.c [new file with mode: 0644]