https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95775
Bug ID: 95775 Summary: Command line argument for target_clones? Product: gcc Version: 10.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: yyc1992 at gmail dot com Target Milestone: --- Would it make sense to add a command line argument that is roughly equivalent to to adding `target_clones` to all functions? In terms of usefulness, I believe it will be a very cheap way for many libraries to turn on the support with minimal code change. It certainly won't be as optimized as best possible but neither is target_clones attribute itself compared to hand wrote different implementations using compiler intrinsics/assembly... In terms of implementation, I believe most of the issues I've hit when adding such attribute to functions has been fixed so I have little issue using it now. It'll also be a new feature so it shouldn't really break any existing code. And for further improvement, the compiler should have fair knowledge of what instruction can be/has been used and can omit some of the cloning in order to reduce code size. I don't think this needs to be included in the first version though... And IIUC this is something that icc does automatically? (If that can serve as a argument for this feature...)