https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128010

--- Comment #5 from nsz at gcc dot gnu.org ---
(In reply to Drea Pinski from comment #4)
> "the point of
> inline syscalls is to minimize register spills and shuffling so
> such spill is not acceptable."
> 
> Because the system call itself will be slow.  So I am not sure you want to
> have this loop in general.
> 
> Can you show where this was showing up because it sounds like just premature
> optimization.

there are many syscalls in libc.so (about 500 svc) that are currently
called inline.

currently the problem is not performance, but correctness: the clobbers
are missing so compiling libc with sve can break (happened with musl).

but adding the existing broad z0..z31 clobbers would cause 500*(d8..d15)
spills inline for no good reason, so at least it would be a code size
regression (+8 insns with stp/ldp so ~16k) and stack use increase and
some perf regression (even if the kernel side is slow i don't think this
is completely marginal).

outlining syscalls is the workaround planned in musl (cheaper than the
spills), but such a change can be intrusive in a libc (it means manually
written asm if libc supports lto, which makes it hard to support future
extensions like bti or instrumentations affecting function entry/exit etc)

Reply via email to