[Bug target/64036] [SH] Evaluate re-enabling scheduling before RA
olegendo at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jul 7 12:44:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64036
--- Comment #3 from Oleg Endo <olegendo at gcc dot gnu.org> ---
I've just tried the following example on the AMS branch:
float fun (float* x)
{
return x[0] + x[1] + x[2] + x[3];
}
no AMS:
mov r4,r1
add #4,r1
fmov.s @r4,fr0
fmov.s @r1,fr1
mov r4,r1
add #8,r1
fadd fr1,fr0
fmov.s @r1,fr1
add #12,r4
fadd fr1,fr0
fmov.s @r4,fr1
rts
fadd fr1,fr0
AMS:
fmov.s @r4+,fr0
fmov.s @r4+,fr1
fadd fr1,fr0 << load dependency stall
fmov.s @r4+,fr1
fadd fr1,fr0 << load dependency stall
fmov.s @r4,fr1
rts
fadd fr1,fr0
AMS + sched1:
fmov.s @r4+,fr0
fmov.s @r4+,fr1
fmov.s @r4+,fr2
fadd fr1,fr0 << no stall
fmov.s @r4,fr1
fadd fr2,fr0 << no stall
rts
fadd fr1,fr0
The sched1 code seems better and it might make sense to enable sched1 after
AMS.
In sh.c there is ...
else if (flag_exceptions)
{
if (flag_schedule_insns && global_options_set.x_flag_schedule_insns)
warning (0, "ignoring -fschedule-insns because of exception "
"handling bug");
flag_schedule_insns = 0;
}
... which makes it impossible to enable sched1 for C++ code unless exceptions
are disabled. Kaz, do you know whether this is still an issue?
More information about the Gcc-bugs
mailing list