lkml.org 
[lkml]   [2020]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 14/18] static_call: Add static_cond_call()
On Tue, May 5, 2020 at 12:00 PM Mathieu Desnoyers
<mathieu.desnoyers@efficios.com> wrote:
>
> ----- On May 5, 2020, at 2:48 PM, Linus Torvalds torvalds@linux-foundation.org wrote:
> [...]
> >
> > Your initial reaction that "you can't compile away the read and the
> > test of NULL" was correct, I think.
>
> I suspect this pattern of "if (func != NULL) func(...)" could be semantically
> changed to just invoking an empty function which effectively does nothing.
> This would remove the need to do a pointer check in the first place. But maybe
> I'm missing something subtle about why it has not been done in this context.

Good idea, this eliminates the check: https://godbolt.org/z/Xugo9w
but you still have an indirect tail call (I think a direct tail call
is the desired solution?)
--
Thanks,
~Nick Desaulniers

\
 
 \ /
  Last update: 2020-05-05 21:58    [W:0.070 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site