Target library is probably more relevant than libc. We have a number of
issues with libm on tier 2 platforms for FreeBSD without assembly fast
paths. This requires work-arounds for the fact that clang likes to say
'oh, this function seems to be calling X on the result of Y, and I know
that this can be more efficient if you replace that sequence with Z',
ignoring the fact that this case is an implementation of Z.
The same thing is true in Objective-C runtime implementations, where we
need to be careful to avoid LLVM performing optimisations on the ARC
functions that result in infinite recursion.
There are numerous cases of compiler-rt suffering from the same issue.
TL;DR: This is a really important problem for clang and your proposed
solution 1 looks like it is far more broadly applicable.
David
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Thx for the feedback David.So we're heading toward a broader> __attribute__((disable_call_synthesis))David what do you think about the additional version that restrict the effect to a few named functions?> e.g. __attribute__((disable_call_synthesis("memset", "memcpy", "sqrt")))
I would find that exceptionally useful. For the libm example,
preventing LLVM from synthesising calls to other libm functions that may
call this one would be the fine-grained control that we want. For an
Objective-C runtime, being able to explicitly disable synthesising ARC
calls would be similarly useful (though I can no longer construct an
example where LLVM does the wrong thing, so maybe this is fixed already
in the ARC passes).