]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
MIPS: Need COSTS_N_INSNS in mips_insn_cost
authorYunQiang Su <syq@gcc.gnu.org>
Thu, 6 Jun 2024 04:28:31 +0000 (12:28 +0800)
committerYunQiang Su <syq@gcc.gnu.org>
Thu, 6 Jun 2024 04:30:46 +0000 (12:30 +0800)
In mips_insn_cost, COSTS_N_INSNS is missing when we return the cost
if count * ratio > 0.

gcc
* config/mips/mips.cc(mips_insn_cost): Add missing COSTS_N_INSNS
to count.

gcc/config/mips/mips.cc

index b478cddc8ad1532bf66e765821fcaf6ff403b017..278d94464826f9bdf6e7e21c53c028b0349fc895 100644 (file)
@@ -4199,7 +4199,7 @@ mips_insn_cost (rtx_insn *x, bool speed)
 
   count = get_attr_insn_count (x);
   ratio = get_attr_perf_ratio (x);
-  cost = count * ratio;
+  cost = COSTS_N_INSNS (count) * ratio;
   if (cost > 0)
     return cost;