Browse Source

dubhe: gcc: Update patch for gcc toolchain

Signed-off-by: kaizhe <kaizhe.mooi@starfivetech.com>
kaizhe 7 months ago
parent
commit
b6f342af90

+ 1 - 0
recipes-devtools/gcc/gcc-12.2.inc

@@ -610,6 +610,7 @@ SRC_URI = "${BASEURI} \
        file://0545-add-multilib-config-for-baremetal.patch \
        file://0546-add-dubhe-pipeline-model.patch \
        file://0547-RISCV-default-enable-align-functions-16-and-align-lo.patch \
+       file://0548-ira-Increase-the-cost-of-inner-loop-spill.patch \
 "
 
 SRC_URI[sha256sum] = "e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff"

+ 44 - 0
recipes-devtools/gcc/gcc/0548-ira-Increase-the-cost-of-inner-loop-spill.patch

@@ -0,0 +1,44 @@
+From 0582802db83d7cce8d3528aa8c2fd952c6537f59 Mon Sep 17 00:00:00 2001
+From: "max.ma" <max.ma@starfivetech.com>
+Date: Mon, 26 Jun 2023 20:27:50 -0700
+Subject: [PATCH 1/1] ira: Increase the cost of inner loop spill
+
+---
+ gcc/ira-costs.cc | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/gcc/ira-costs.cc b/gcc/ira-costs.cc
+index 964c94a06ef..d2040f04be7 100644
+--- a/gcc/ira-costs.cc
++++ b/gcc/ira-costs.cc
+@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3.  If not see
+ #include "ira-int.h"
+ #include "addresses.h"
+ #include "reload.h"
++#include "cfgloop.h"
+ 
+ /* The flags is set up every time when we calculate pseudo register
+    classes through function ira_set_pseudo_classes.  */
+@@ -1624,10 +1625,19 @@ static void
+ process_bb_for_costs (basic_block bb)
+ {
+   rtx_insn *insn;
++  int depth;
+ 
+   frequency = REG_FREQ_FROM_BB (bb);
+   if (frequency == 0)
+     frequency = 1;
++  if (bb->loop_father)
++    {
++      depth = loop_depth(bb->loop_father);
++      depth = depth > 5 ? 5 : depth;
++      while (depth--)
++        frequency *= 5;
++    }
++
+   FOR_BB_INSNS (bb, insn)
+     insn = scan_one_insn (insn);
+ }
+-- 
+2.25.1
+