On 11/18/26 7:12 AM, Jin Ma wrote:
Group eligible scalar memory accesses by register file, access kind,
mode and base register.  Reuse the memory-pair rules to choose their
offset order, preferring increasing offsets for bidirectional candidates.
Use the common scheduling fusion pass gate.  Leave final pair
recognition to the macro-fusion matcher.

Builds of the ten SPEC CPU 2017 Integer benchmarks used the LP64D ABI
and -mcpu=xt-c9501fdvt -O3 -flto -static.  The baseline is the parent
of this patch.  Both builds used the default scheduling options.

The tables count static macro-fusion pairs in the final LTO sched2
dumps for each benchmark's main executable, collected with
-fsched-verbose=9 -fdump-rtl-sched2-all.  The load/store subset
includes both increasing and decreasing offset pairs.

All macro-fusion pairs

Case            Baseline This patch   Change
500.perlbench_r    31421      34370   +9.39%
502.gcc_r         125528     135648   +8.06%
505.mcf_r            227        254  +11.89%
520.omnetpp_r      23942      25621   +7.01%
523.xalancbmk_r    48627      50971   +4.82%
525.x264_r          7515       8301  +10.46%
531.deepsjeng_r      887        982  +10.71%
541.leela_r         1346       1436   +6.69%
548.exchange2_r     2233       2868  +28.44%
557.xz_r            2069       2289  +10.63%
SUM               243795     262740   +7.77%

Load/store pairs

Case            Baseline This patch   Change
500.perlbench_r    18803      21637  +15.07%
502.gcc_r          89154      98676  +10.68%
505.mcf_r            132        156  +18.18%
520.omnetpp_r      17989      19628   +9.11%
523.xalancbmk_r    38268      40639   +6.20%
525.x264_r          4548       5247  +15.37%
531.deepsjeng_r      385        464  +20.52%
541.leela_r          899        990  +10.12%
548.exchange2_r     1388       1985  +43.01%
557.xz_r            1422       1631  +14.70%
SUM               172988     191053  +10.44%

Assisted-by: qwenwork

gcc/ChangeLog:

        * config/riscv/riscv-fusion.cc (riscv_fuse_mem_direction): New function.
        (riscv_sched_fusion_priority): Likewise.
        * config/riscv/riscv-protos.h (riscv_sched_fusion_priority): Declare.
        * config/riscv/riscv.cc (TARGET_SCHED_FUSION_PRIORITY): Define.

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/sched-fusion-priority.c: New test.
        * gcc.target/riscv/sched-fusion-priority-extended.c: Likewise.
        * gcc.target/riscv/sched-fusion-priority-off.c: Likewise.
        * gcc.target/riscv/sched-fusion-default.c: New test.
        * gcc.target/riscv/sched-fusion-option-restore.c: Likewise.
        * gcc.target/riscv/sched-fusion-unsupported-tune.c: Likewise.

Co-Authored-By: Michiel Derhaeg <[email protected]>
Signed-off-by: Jin Ma <[email protected]>
Thanks.  I've pushed this to the trunk as well.

jeff

Reply via email to