https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95775
--- Comment #2 from Yichao Yu <yyc1992 at gmail dot com> --- > But it will blow up code-size considerably. > So without some major work I don't think simply slapping target_clones on > each function is going to fly in practice. I mean, it'll blow up not much more than the number of targets. I do agree this is not something that the compiler should just do automatically and especially not for big libraries and the user has to ask for it. However, I don't believe code side consumes most memory on any modern desktop or server systems and when using shared library different process won't even consume much more memory anyway. It's for sure still the user's choice but OTOH I think the compiler shouldn't have to make this choice for the user. Additionally, there are some libraries, like math heavy ones, where virtually every single functions could benefit from this. Those are the ones that I would like to apply this option too. I'm also hoping, and I forgot to mention this in the first post, that this can just work on gfortran as well... > Eventually it should be possible to do sth like target_clones(auto) where > with a new option, the target (or the user) can define "default" targets to > clone for but the user still figures which are the important functions to > optimize In julia I'm currently using a simple heuristic of detecting floating point operation, vector operation and loops... > [and GCC may, via IPA "spread" the cloned cgraph portion a bit]. and I do this in julia too.