https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114978
--- Comment #8 from chenglulu <chenglulu at loongson dot cn> --- (In reply to Chen Chen from comment #0) > We tested Loongarch64 CPU Loongson 3A6000 with "LA664" architecture in Linux > operating system AOSC OS 11.4.0 (default gcc version is 13.2.0). And we > found the 548.exchange2_r benchmark from SPEC 2017 INTrate suite suffered > significant regressions from 14% to 28% with various compiling options. > > The rate-1 results are following: > /* snip */ > > after snapshot 20240317 score 18-23.1% lower with parameters "-g -Ofast > -march=la664": > 13.2.0: "-march=la664" flag is not supported > 20240317: 11.5 (227s) > 20240324: 8.84 (296s) > 20240430: 9.43 (278s) > 14.1.0: 9.42 (278s) > /* snip */ > > > after snapshot 20240317 score 26.3-26.6% lower with parameters "-g -Ofast > -march=la464": > 13.2.0: 8.76 (299s) > 20240317: 12.8 (205s) > 20240324: 9.39 (279s) > 20240430: 9.43 (278s) > 14.1.0: 9.43 (278s) > > > 20240317: 11.5 (227s) -march=la664 > 20240317: 12.8 (205s) -march=la464 I looked for the reason for the gap between the above two results. The performance regression is caused by r14-6814. If the following modifications are made, the scores of -march=la664 and -march464 will be the same. diff --git a/gcc/config/loongarch/loongarch-def.cc b/gcc/config/loongarch/loongarch-def.cc index e8c129ce643..f27284cb20a 100644 --- a/gcc/config/loongarch/loongarch-def.cc +++ b/gcc/config/loongarch/loongarch-def.cc @@ -111,11 +111,7 @@ loongarch_rtx_cost_data::loongarch_rtx_cost_data () tune targets (i.e. -mtune=native while PRID does not correspond to any known "-mtune" type). */ array_tune<loongarch_rtx_cost_data> loongarch_cpu_rtx_cost_data = - array_tune<loongarch_rtx_cost_data> () - .set (CPU_LA664, - loongarch_rtx_cost_data () - .movcf2gr_ (COSTS_N_INSNS (1)) - .movgr2cf_ (COSTS_N_INSNS (1))); + array_tune<loongarch_rtx_cost_data> ();