diff options
author | Xiao Zeng <zengxiao@eswincomputing.com> | 2023-09-29 16:29:02 -0600 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2023-09-29 16:35:16 -0600 |
commit | 44efc743acc01354b6b9eb1939aedfdcc44e71f3 (patch) | |
tree | ec6cc7dd7e73be9e820dd018ce529947e1f13768 /gcc/fibonacci_heap.h | |
parent | 4f1e5379fd77c744111672ab3d961cecb4826b80 (diff) | |
download | gcc-44efc743acc01354b6b9eb1939aedfdcc44e71f3.zip gcc-44efc743acc01354b6b9eb1939aedfdcc44e71f3.tar.gz gcc-44efc743acc01354b6b9eb1939aedfdcc44e71f3.tar.bz2 |
Fix INSN costing and more zicond tests
So this ends up looking a lot like the bits that I had to revert several weeks
ago :-)
The core issue we have is given an INSN the generic code will cost the SET_SRC
and SET_DEST and sum them. But that's far from ideal on a RISC target.
For a register destination, the cost can be determined be looking at just the
SET_SRC. Which is precisely what this patch does. When the outer code is an
INSN and we're presented with a SET we take one of two paths.
If the destination is a register, then we recurse just on the SET_SRC and we're
done. Otherwise we fall back to the existing code which sums the cost of the
SET_SRC and SET_DEST. That fallback path isn't great and probably could be
further improved (just costing SET_DEST in that case is probably quite
reasonable).
The difference between this version and the bits that slipped through by
accident several weeks ago is that old version mis-used the API due to a thinko
on my part.
This tightens up various zicond tests to avoid undesirable matching.
This has been tested on rv64gc -- the only difference it makes on the testsuite
is the new tests (included in this patch) flip from failing to passing.
Pushed to the trunk.
gcc/
* config/riscv/riscv.cc (riscv_rtx_costs): Better handle costing
SETs when the outer code is INSN.
gcc/testsuite
* gcc.target/riscv/zicond-primitiveSemantics_compare_imm.c: New test.
* gcc.target/riscv/zicond-primitiveSemantics_compare_imm_return_0_imm.c:
Likewise.
* gcc.target/riscv/zicond-primitiveSemantics_compare_imm_return_imm_imm.c:
Likewise.
* gcc.target/riscv/zicond-primitiveSemantics_compare_imm_return_imm_reg.c:
Likewise.
* gcc.target/riscv/zicond-primitiveSemantics_compare_imm_return_reg_reg.c:
Likewise.
* gcc.target/riscv/zicond-primitiveSemantics_compare_reg.c: Likewise.
* gcc.target/riscv/zicond-primitiveSemantics_compare_reg_return_0_imm.c:
Likewise.
* gcc.target/riscv/zicond-primitiveSemantics_compare_reg_return_imm_imm.c:
Likewise.
* gcc.target/riscv/zicond-primitiveSemantics_compare_reg_return_imm_reg.c:
Likewise.
* gcc.target/riscv/zicond-primitiveSemantics_compare_reg_return_reg_reg.c:
Likewise.
* gcc.target/riscv/zicond-primitiveSemantics.c: Tighten expected regexp.
* gcc.target/riscv/zicond-primitiveSemantics_return_0_imm.c: Likewise.
* gcc.target/riscv/zicond-primitiveSemantics_return_imm_imm.c: Likewise.
* gcc.target/riscv/zicond-primitiveSemantics_return_imm_reg.c: Likewise.
* gcc.target/riscv/zicond-primitiveSemantics_return_reg_reg.c: Likewise.
* gcc.target/riscv/zicond-xor-01.c: Likewise.
Diffstat (limited to 'gcc/fibonacci_heap.h')
0 files changed, 0 insertions, 0 deletions