Hi,
On 10/9/25 23:06, Jakub Jelinek wrote:
On Thu, Oct 09, 2025 at 10:25:45PM +0200, Josef Melcr wrote:
On 10/9/25 12:58, Tobias Burnus wrote:
Still, I think enabling it always with -O2 - or at least when
'static' and only called once makes sense.
Enabling it by default for static functions only called once is a good
start. It makes a lot of sense and it will also allow me to gauge the
complexity of solving the rest.
Doesn't have to be necessarily called just once, but it really needs
to be static and not called directly and only called in the case with
explicit or implicit GNU callback attribute (because those attributes
guarantee that the callee to which the callback is passed doesn't leak it
anywhere where something else could call those).
You are right, thank you for pointing that out. We could probably
implement it incrementally, start with simple cases like called once and
then expand it further.
BTW, for .ASSUME ifn which really would be nice to get handled as well,
it also due to inlining can have multiple callers, but the function in
that case is magic, not actually emitted into assembly. And while e.g.
cp into the function might help, the most important would be IPA-SRA.
If it agrees on all callers (or clones the magic function), in that case
it even doesn't have to keep a single pointer data pointing to some
structure, it can change the number of arguments to the function, and
ideally split all the ones passing structures to the actually used scalar
elements.
ASSUME is on my mind since it was first mentioned when I submitted v1 of
this patch. With the special casing mechanism in place, it would
definitely be possible, but the thing I kinda struggle with is
priority. I do have some top priorities, like implementing the summary
to save space in the cgraph_edge class, but then there are features like
the GOMP_task copy function support, omp target or IFN_ASSUME support
and I am not sure which of these is the most important. Do you have any
thoughts on that? :)
Jakub
Best regards,
Josef