public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets
@ 2024-04-23 10:47 Manolis Tsamis
  2024-04-23 10:47 ` [PATCH v4 1/3] [RFC] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets Manolis Tsamis
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Manolis Tsamis @ 2024-04-23 10:47 UTC (permalink / raw)
  To: gcc-patches
  Cc: Robin Dapp, Jiangning Liu, Philipp Tomsich, Richard Sandiford,
	Jakub Jelinek, Manolis Tsamis


noce_convert_multiple_sets has been introduced and extended over time to handle
if conversion for blocks with multiple sets. Currently this is focused on
register moves and rejects any sort of arithmetic operations.

This series is an extension to allow more sequences to take part in if
conversion. The first patch is a required change to emit correct code and the
second patch whitelists a larger number of operations through
bb_ok_for_noce_convert_multiple_sets. The third patch adds support to rewire
multiple registers in noce_convert_multiple_sets_1 and refactors the code with
a new helper info struct. The fourth patch removes some old code that should
not be needed anymore.

For targets that have a rich selection of conditional instructions,
like aarch64, I have seen an ~5x increase of profitable if conversions for
multiple set blocks in SPEC benchmarks. Also tested with a wide variety of
benchmarks and I have not seen performance regressions on either x64 / aarch64.

Some samples that previously resulted in a branch but now better use these
instructions can be seen in the provided test cases.

Bootstrapped and tested on AArch64 and x86-64.


Changes in v4:
        - Remove unnecessary hardcoded list of allowed ops in
        bb_ok_for_noce_convert_multiple_sets.
        - Set need_cmov based on BB live_out instead of REG_DEAD notes.
        - Fix preexisting issues and improve the code that sets read_comparison.

Manolis Tsamis (3):
  [RFC] ifcvt: handle sequences that clobber flags in
    noce_convert_multiple_sets
  [RFC] ifcvt: Allow more operations in multiple set if conversion
  [RFC] ifcvt: Handle multiple rewired regs and refactor
    noce_convert_multiple_sets

 gcc/ifcvt.cc                                  | 383 ++++++++----------
 gcc/ifcvt.h                                   |  16 +
 .../aarch64/ifcvt_multiple_sets_arithm.c      |  79 ++++
 .../aarch64/ifcvt_multiple_sets_rewire.c      |  20 +
 4 files changed, 292 insertions(+), 206 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_arithm.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_rewire.c

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-14 12:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 10:47 [PATCH v4 0/3] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets Manolis Tsamis
2024-04-23 10:47 ` [PATCH v4 1/3] [RFC] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets Manolis Tsamis
2024-04-23 10:47 ` [PATCH v4 2/3] [RFC] ifcvt: Allow more operations in multiple set if conversion Manolis Tsamis
2024-04-24 23:40   ` Hans-Peter Nilsson
2024-04-30 14:54     ` Manolis Tsamis
2024-04-23 10:47 ` [PATCH v4 3/3] [RFC] ifcvt: Handle multiple rewired regs and refactor noce_convert_multiple_sets Manolis Tsamis
2024-05-14 12:06 ` [PATCH v4 0/3] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets Manolis Tsamis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).