On Mon, Jan 5, 2026 at 9:27 AM Y Song <[email protected]> wrote:

> On Sun, Jan 4, 2026 at 9:49 AM David Blaikie <[email protected]> wrote:
> >
> > Coming back to the fundamental problem you're trying to solve - am I
> understanding correctly it is this:
> >
> > Compiler optimizes a function and doesn't preserve it's ABI.
> > You want to allow your users of BPF to write a call to, or
> reimplementation of (which is it? is it some third thing?) this function
> that matches the lowered/non-ABI matching signature.
>
> Yes. There is no reimplementation here. Users should just use the
> *real* signatures.
>

What are they using it for, though? What are the users?


> > So you'd like DWARF (well, BPF, which is built from DWARF? encoded in
> DWARF?) to encode a source signature that is equivalent to the
> optimized/new calling convention of the function?
>
> There is no BPF involved here. The signature changed should be encoded in
> dwarf.
>

That's the claim we're debating, I think. Classically DWARF has said
nothing about how to /call/ a function, what it's ABI or calling convention
is - well, in DWARFv5 we did at least add a calling convention attribute to
tell consumers whether a function matches the normal calling convention for
the platform - or if it doesn't follow it, and the consumers shouldn't try
to synthesize calls to this function.


> > But folks here are pushing back by suggesting that that optimized
> calling convention may not be representable in the source language? which I
> think is accurate/fair...
>
> Could you clarify here? In the compiler, we can capture the changed
> signature. BTW, currently we only target the C language as it is our
> use case.
>

 Frank's response covers this pretty well - a concrete example might be
inter-function register allocation. A compiler could, for instance, avoid
using the usual first argument register because it wants to preserve that
in the caller - only using the second register. Or rely on walking into the
previous stack frame (knowing its layout) to find parameter info, etc...

 - Dave
-- 
Dwarf-discuss mailing list
[email protected]
https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss

Reply via email to