在 2024/6/28 下午8:25, Xi Ruoyao 写道:
Hi Richard,

The late combine pass has triggered some FAILs on LoongArch and I'm
investigating.  One of them is movcf2gr-via-fr.c.  In 315r.postreload:

(insn 22 7 24 2 (set (reg:FCC 32 $f0 [87])
         (reg:FCC 64 $fcc0 [87])) 
"../gcc/gcc/testsuite/gcc.target/loongarch/movcf2gr-via-fr.c":9:12 168 
{movfcc_internal}
      (nil))
(insn 24 22 8 2 (set (reg:FCC 4 $r4 [88])
         (reg:FCC 32 $f0 [87])) 
"../gcc/gcc/testsuite/gcc.target/loongarch/movcf2gr-via-fr.c":9:12 168 
{movfcc_internal}
      (nil))

The late combine pass combines these to:

(insn 24 7 8 2 (set (reg:FCC 4 $r4 [88])
         (reg:FCC 64 $fcc0 [87])) 
"../gcc/gcc/testsuite/gcc.target/loongarch/movcf2gr-via-fr.c":9:12 168 
{movfcc_internal}
      (nil))

But we are using a FPR ($f0) here deliberately to work around an
architectural issue in LA464 causing a direct FCC-to-GPR move very slow.

Could you suggest how to fix this issue?

Hi, Ruoyao:

We need to define TARGET_INSN_COST and set the cost of movcf2gr/movgr2cf.

I've fixed this and am doing correctness testing now.


On Thu, 2024-06-20 at 14:34 +0100, Richard Sandiford wrote:
This series is a resubmission of the late-combine work.  I've fixed
some bugs that Jeff's cross-target CI found last time and some others
that I hit since then.
/* snip */


Reply via email to