diff options
author | Jeff Law <jlaw@ventanamicro.com> | 2024-08-17 09:52:55 -0600 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2024-08-17 09:52:55 -0600 |
commit | 7aed8dedeb9613925930447bf2457c3fd9972d91 (patch) | |
tree | ff0c237cc5f66bd8d2a10318b422759c95c07d74 /gcc/digraph.h | |
parent | 3f51684ac05f065a87c53d9506400cbe97af6b79 (diff) | |
download | gcc-7aed8dedeb9613925930447bf2457c3fd9972d91.zip gcc-7aed8dedeb9613925930447bf2457c3fd9972d91.tar.gz gcc-7aed8dedeb9613925930447bf2457c3fd9972d91.tar.bz2 |
[RISC-V][PR target/116282] Stabilize pattern conditions
So as expected the core problem with target/116282 is that the cost of certain
constant synthesis cases varied depending on whether or not we're allowed to
generate new pseudos or not.
That in turn meant that in obscure cases an insn might change from recognizable
to unrecognizable and triggers the observed failure.
So we need to keep the cost stable, at least when called from a pattern's
condition. So we pass another boolean down when necessary. I've tried to keep
API fallout minimized.
Built and tested on rv32 in my tester. Let's see what pre-commit testing has
to say though 🙂
Note this will also require a minor change to the in-flight constant synthesis
work.
PR target/116282
gcc/
* config/riscv/riscv-protos.h (riscv_const_insns): Add new argument.
* config/riscv/riscv.cc (riscv_build_integer): Add new argument
ALLOW_NEW_PSEUDOS. Pass it down to recursive calls and check it
before using synthesis which allows new registers to be created.
(riscv_split_integer_cost): Pass new argument to riscv_build_integer.
(riscv_integer_cost): Add ALLOW_NEW_PSEUDOS argument, pass it down to
riscv_build_integer.
(riscv_legitimate_constant_p): Pass new argument to riscv_const_insns.
(riscv_const_insns): New argment ALLOW_NEW_PSEUDOS. Pass it down to
riscv_integer_cost and riscv_const_insns.
(riscv_split_const_insns): Pass new argument to riscv_const_insns.
(riscv_move_integer, riscv_rtx_costs): Similarly.
* config/riscv/riscv.md (shadd with costly constant): Pass new argument
to riscv_const_insns.
* config/riscv/bitmanip.md (and with costly constant): Pass new argument
to riscv_const_insns.
gcc/testsuite/
* gcc.target/riscv/pr116282.c: New test.
Diffstat (limited to 'gcc/digraph.h')
0 files changed, 0 insertions, 0 deletions