On Fri, 2024-06-28 at 20:34 +0800, chenglulu wrote: > > 在 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.
Ah thanks! So it uses insn cost instead of rtx cost and I didn't realize. -- Xi Ruoyao <xry...@xry111.site> School of Aerospace Science and Technology, Xidian University