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

--- Comment #2 from Jose E. Marchesi <jemarch at gcc dot gnu.org> ---
As far as I can tell the feature requires no inlining to happen.  From the llvm
patch:

----
After this patch-set verifier would rewrite the program below:

  r2 = 1
  *(u64 *)(r10 - 32) = r2
  call %[bpf_cast_to_kern_ctx]
  r2 = *(u64 *)(r10 - 32)
  r0 = r2;"

As follows:

  r2 = 1   /* spill/fill at r10[-32] is removed */
  r0 = r1  /* replacement for bpf_cast_to_kern_ctx() */
  r0 = r2
  exit
----

i.e. the call to bpf_cast_to_kern_ctx is not inlined, but shouldn't impact
register presure like if it was marked with nocsr.  The argument and return
value handling instructions are generated ad-hoc for the call, and in a shape
that is recognized by the BPF loader.  Then the BPF loader replaces the call
with something else.  It is akin to inlining at load time, which may or may not
happen depending on the version of the kernel.

Reply via email to