]> gcc.gnu.org Git - gcc.git/commit
RISC-V: Generate vt.maskc<n> on noce_try_store_flag_mask if-conversion
authorPhilipp Tomsich <philipp.tomsich@vrull.eu>
Sat, 5 Mar 2022 22:21:10 +0000 (23:21 +0100)
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>
Thu, 1 Dec 2022 13:22:03 +0000 (14:22 +0100)
commitefee69b0eec53614f6360ceeaf60d4c886b2ce6e
treef41af0f783948e5528f420949b82230be48944e0
parent7684dea9c91a69008bc270f74f5db47b24ebad3c
RISC-V: Generate vt.maskc<n> on noce_try_store_flag_mask if-conversion

Adds a pattern to map the output of noce_try_store_flag_mask
if-conversion in the combiner onto vt.maskc<n>; the input patterns
supported are similar to the following:
  (set (reg/v/f:DI 75 [ <retval> ])
       (and:DI (neg:DI (ne:DI (reg:DI 82)
                       (const_int 0 [0])))
               (reg/v/f:DI 75 [ <retval> ])))

This reduces dynamic instruction counts for the perlbench-workload in
SPEC CPU2017 by 0.8230%, 0.4689%, and 0.2332% (respectively, for the
each of the 3 workloads in the 'ref'-workload).

To ensure that the combine-pass doesn't get confused about
profitability, we recognize the idiom as requiring a single
instruction when the XVentanaCondOps extension is present.

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_rtx_costs): Recognize idiom for
  vt.maskc<n> as a single insn with TARGET_XVENTANACONDOPS.
* config/riscv/riscv.md: Include xventanacondops.md.
* config/riscv/xventanacondops.md: New file.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/xventanacondops-ne-03.c: New test.
* gcc.target/riscv/xventanacondops-ne-04.c: New test.

Commit-changes: 2
- Ran whitespace-cleanup on xventanacondops-ne-03.c
- Ran whitespace-cleanup on xventanacondops-ne-04.c
gcc/config/riscv/riscv.cc
gcc/config/riscv/riscv.md
gcc/config/riscv/xventanacondops.md [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/xventanacondops-ne-03.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/xventanacondops-ne-04.c [new file with mode: 0644]
This page took 0.061494 seconds and 6 git commands to generate.