From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9DA263851C25; Sat, 20 Jun 2020 00:53:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DA263851C25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592614401; bh=gMaTTregV6ZPxW+y8p9/ohmuefwgC2nMapHjnCw+/pE=; h=From:To:Subject:Date:From; b=THELKMOe/XnsPLYoPvMKDvmWLN6Jbvng/hRtlEpf2rw0kg5IctO/AlTnVvjdbIOnc kRuLhpoX8rDqVOPGq4YcY/SEhbypSD8PXsM1nD/uFfP/VyEqB3SvAHZuDKTp3Ryd8A Hw8Ol3RHpI0kjhSmEatz9nblW8/kHbcJET7vTY/4= From: "yyc1992 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95775] New: Command line argument for target_clones? Date: Sat, 20 Jun 2020 00:53:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: yyc1992 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 00:53:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95775 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 equivale= nt 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 its= elf compared to hand wrote different implementations using compiler intrinsics/assembly... In terms of implementation, I believe most of the issues I've hit when addi= ng 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 vers= ion though... And IIUC this is something that icc does automatically? (If that can serve = as a argument for this feature...)=