[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YHA3iGyT5dMq7/06@hirez.programming.kicks-ass.net>
Date: Fri, 9 Apr 2021 13:16:24 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Florian Weimer <fweimer@...hat.com>
Cc: Ard Biesheuvel <ardb@...nel.org>, linux-toolchains@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Jason Baron <jbaron@...mai.com>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>
Subject: Re: static_branch/jump_label vs branch merging
On Fri, Apr 09, 2021 at 12:55:18PM +0200, Florian Weimer wrote:
> * Ard Biesheuvel:
>
> > Wouldn't that require the compiler to interpret the contents of the
> > asm() block?
>
> Yes and no. It would require proper toolchain support, so in this case
> a new ELF relocation type, with compiler, assembler, and linker support
> to generate those relocations and process them. As far as I understand
> it, the kernel doesn't do things this way.
I don't think that all is needed. All we need is for the compiler to
recognise that:
if (cond) {
stmt-A;
}
if (cond) {
stmt-B;
}
both cond are equivalent and hence can merge the blocks like:
if (cond) {
stmt-A;
stmt-B;
}
But because @cond is some super opaque asm crap, the compiler throws up
it's imaginry hands and says it cannot possibly tell and leaves them as
is.
Powered by blists - more mailing lists