Re: [PATCH 2/4] s390/percpu: Drop unused output register from arch_this_cpu_add()

From: David Laight

Date: Wed Oct 14 2026 - 08:28:37 EST


On Mon, 12 Oct 2026 15:24:20 +0200
Alexander Gordeev <agordeev@xxxxxxxxxxxxx> wrote:

> On Mon, Oct 12, 2026 at 01:42:47PM +0200, Heiko Carstens wrote:
> > The laa/laag instructions return the old memory content, but
> > arch_this_cpu_add() does not need it. Instead of allocating a dedicated
> > output register old__ just to discard the returned value, change the
> > val__ constraint from "d" to "+&d" so it is used as input/output
> > register.
> >
> > This reduces register pressure.
>
> Do you know whether the compiler is may be smart enough to select the
> same register for old and val himself?

Given gcc tends to allocate a new register for x++ I doubt it
(and then has to do a reg-reg move to put it back).

David