]> git.ipfire.org Git - thirdparty/gcc.git/commit
MIPS: Implement TARGET_INSN_COSTS
authorYunQiang Su <syq@gcc.gnu.org>
Fri, 29 Dec 2023 17:34:28 +0000 (01:34 +0800)
committerYunQiang Su <syq@gcc.gnu.org>
Thu, 4 Jan 2024 01:55:09 +0000 (09:55 +0800)
commit9876d50eb3286cd2b53c92d5ea409b8b228586c3
treee06b08d79867c796b0620b3440da3a9349c3dbb3
parentffdbb8e02280e37b2f81ed40b98f7168dc502c52
MIPS: Implement TARGET_INSN_COSTS

When combine some instructions, the generic `rtx_cost`
may over estimate the cost of result RTL, due to that
the RTL may be quite complex and `rtx_cost` has no
information that this RTL can be convert to simple
hardware instruction(s).

In this case, Let's use `insn_count * perf_ratio` to
estimate the cost if both of them are available.
Otherwise fallback to pattern_cost.

When non-speed, Let's use the length as cost.

gcc

* config/mips/mips.cc (mips_insn_cost): New function.

gcc/testsuite

* gcc.target/mips/data-sym-multi-pool.c: Skip Os or -O0.
gcc/config/mips/mips.cc
gcc/testsuite/gcc.target/mips/data-sym-multi-pool.c