]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Include rtl.h for COSTS_N_INSNS instead of hard coding our own
authorXi Ruoyao <xry111@xry111.site>
Sat, 9 Dec 2023 07:27:28 +0000 (15:27 +0800)
committerXi Ruoyao <xry111@xry111.site>
Sun, 17 Dec 2023 11:23:28 +0000 (19:23 +0800)
With loongarch-def.cc switched from C to C++, we can include rtl.h for
COSTS_N_INSNS, instead of hard coding our own.

THis is a non-functional change for now, but it will make the code more
future-proof in case COSTS_N_INSNS in rtl.h would be changed.

gcc/ChangeLog:

* config/loongarch/loongarch-def.cc (rtl.h): Include.
(COSTS_N_INSNS): Remove the macro definition.

gcc/config/loongarch/loongarch-def.cc

index c41804a180e232be208605ae232d08809e445165..6217b19268c4631c471dae9e691d1ff5f59792bb 100644 (file)
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
+#include "rtl.h"
 
 #include "loongarch-def.h"
 #include "loongarch-str.h"
@@ -89,8 +90,6 @@ array_tune<loongarch_align> loongarch_cpu_align =
     .set (CPU_LA464, la464_align ())
     .set (CPU_LA664, la464_align ());
 
-#define COSTS_N_INSNS(N) ((N) * 4)
-
 /* Default RTX cost initializer.  */
 loongarch_rtx_cost_data::loongarch_rtx_cost_data ()
   : fp_add (COSTS_N_INSNS (1)),