lkml.org 
[lkml]   [2021]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: static_branch/jump_label vs branch merging
On Fri, Apr 09, 2021 at 11:57:22AM +0200, Ard Biesheuvel wrote:
> On Thu, 8 Apr 2021 at 18:53, Peter Zijlstra <peterz@infradead.org> wrote:

> > Is there *any* way in which we can have the compiler recognise that the
> > asm_goto only depends on its arguments and have it merge the branches
> > itself?
> >
> > I do realize that asm-goto being volatile this is a fairly huge ask, but
> > I figured I should at least raise the issue, if only to raise awareness.
> >
>
> Wouldn't that require the compiler to interpret the contents of the asm() block?

Yeah, this is more or less asking for ponies :-) One option would be
some annotation that conveys the desired semantics without it having to
untangle the mess in the asm block.

The thing the compiler needs to know is that the branch is constant for
any @key, and hence allow the obvious optimizations. I'm not sure if
this is something compiler folks would be even willing to consider, but
I figured asking never hurts.

\
 
 \ /
  Last update: 2021-04-09 13:13    [W:0.096 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site