<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Jan 5, 2026 at 9:27 AM Y Song <<a href="mailto:ys114321@gmail.com">ys114321@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, Jan 4, 2026 at 9:49 AM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
><br>
> Coming back to the fundamental problem you're trying to solve - am I understanding correctly it is this:<br>
><br>
> Compiler optimizes a function and doesn't preserve it's ABI.<br>
> 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.<br>
<br>
Yes. There is no reimplementation here. Users should just use the<br>
*real* signatures.<br></blockquote><div><br>What are they using it for, though? What are the users?<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> 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?<br>
<br>
There is no BPF involved here. The signature changed should be encoded in dwarf.<br></blockquote><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> 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...<br>
<br>
Could you clarify here? In the compiler, we can capture the changed<br>
signature. BTW, currently we only target the C language as it is our<br>
use case.<br></blockquote><div><br> 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... <br><br> - Dave</div></div></div>