| Message ID | 20260506120012.D2F434BA23EF@sourceware.org |
|---|---|
| State | New |
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D2F434BA23EF for <patchwork@sourceware.org>; Wed, 6 May 2026 12:00:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2F434BA23EF Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=VY0Qe9Be; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=aPWx67Ts; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=VY0Qe9Be; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=aPWx67Ts X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 181BD4BA23EF for <gcc-patches@gcc.gnu.org>; Wed, 6 May 2026 11:59:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 181BD4BA23EF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 181BD4BA23EF Authentication-Results: sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778068741; cv=none; b=DDAonufCrrE6iL5lwSsW0D+V2QICFOPO+in8IVd9AHaoy8Ot2aG58fQfbp7+OcKL3YIUfG9UQUz541C8EU47aFQd1ZHoIk70N8Q38gwJhDpcbI2tu4RRCCnTI1PYTED+VB/Ak4xzIKWlbAYs/VVL0RUZ1cz4pxj7eN2RTAQ0ZqE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778068741; c=relaxed/simple; bh=GR9VfMFE0cTjezXk8q+pXTAi5Pdk8gkfms5sWNWh71Q=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version; b=j+kxCm5UNIu4ItvlgxH/ynkQBWrV79bYm7RXXFqeMU2yTFwlOx1CxeXuDYPlXLpXgH1du76QaMLlrnWUBgNoD75pVzrt6Wz2dmIeaUWepnrb8Nft3Y0jG23umbD+0zANqCSAdsfLRhVRDhdgXL2eX0kJ/+yL7GUDF178jxdiAo0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=VY0Qe9Be; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=aPWx67Ts; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=VY0Qe9Be; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=aPWx67Ts DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 181BD4BA23EF Received: from murzim.nue2.suse.org (unknown [10.168.4.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 174F85CAE3; Wed, 6 May 2026 11:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1778068740; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=cNE7r4nl1ZNArW2miHLMdQC7W6viWLBeSY0LBkKupnI=; b=VY0Qe9BelsZTi5Jwx5z0Mq3PwGmSnh6vqgoy15hZRbHgPEqHGav3CEtbSy+ALyXTbYwOuw 6bxINNpJ+Bh0RtPP6aFmO5MB3xJ/OcgnddHFmmwxjk3qAXWGeJ72TVA3sXJoS2SbWn80IZ P/S8DFmExyfBgzpQsoag/U04exHjZ/M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1778068740; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=cNE7r4nl1ZNArW2miHLMdQC7W6viWLBeSY0LBkKupnI=; b=aPWx67Ts8d4LZR/GhJchBqp4qs10U4nCjxA3dkVGLUm+YuhOwB45L+pti0k7goQ7JTzrAS rwVxxdC9ECkp8bCQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1778068740; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=cNE7r4nl1ZNArW2miHLMdQC7W6viWLBeSY0LBkKupnI=; b=VY0Qe9BelsZTi5Jwx5z0Mq3PwGmSnh6vqgoy15hZRbHgPEqHGav3CEtbSy+ALyXTbYwOuw 6bxINNpJ+Bh0RtPP6aFmO5MB3xJ/OcgnddHFmmwxjk3qAXWGeJ72TVA3sXJoS2SbWn80IZ P/S8DFmExyfBgzpQsoag/U04exHjZ/M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1778068740; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=cNE7r4nl1ZNArW2miHLMdQC7W6viWLBeSY0LBkKupnI=; b=aPWx67Ts8d4LZR/GhJchBqp4qs10U4nCjxA3dkVGLUm+YuhOwB45L+pti0k7goQ7JTzrAS rwVxxdC9ECkp8bCQ== Date: Wed, 6 May 2026 13:59:00 +0200 (CEST) From: Richard Biener <rguenther@suse.de> To: gcc-patches@gcc.gnu.org cc: tamar.christina@arm.com, hongtao.liu@intel.com, rdsandiford@googlemail.com Subject: [PATCH 2/2] [x86] adjust OMP SIMD call cost MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Score: -1.80 X-Spamd-Result: default: False [-1.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MISSING_MID(2.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; MISSING_XM_UA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FREEMAIL_ENVRCPT(0.00)[googlemail.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_CC(0.00)[arm.com,intel.com,googlemail.com]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4] X-Spam-Level: X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MISSING_MID, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Message-Id: <20260506120012.D2F434BA23EF@sourceware.org> |
| Series |
[1/2] tree-optimization/125174 - cost OMP SIMD calls
|
|
Commit Message
Richard Biener
May 6, 2026, 11:59 a.m. UTC
The following adds special handling to OMP SIMD vector call costs which were not costed at all and for which a single simple vector stmt isn't appropriate. PR125174 shows that even when AVX imposes more overhead (from also slightly bogus costing) than SSE, when there's two OMP SIMD calls involved doing less of those should trump that. Bootstrap & regtest ongoing on x86_64-unknown-linux-gnu. I've verified this resolves the observed 465.tonto regression. I thought about catching all OMP SIMD vectorized stmts but then realized scalar costing doesn't see this yet so we'll make all vectorizations unprofitable. We cannot handle all calls this way either, as some directly expand to native insns (popcount, etc.). So I fear we have to maintain a positive list. There's 52 'notinbranch' SIMD declatations in glibc 2.38 on x86_64, probably different ones on ARM. Also we of course have no idea about actual cost of the call (but it's expensive). Nor do we have an idea of the scalar vs. vector cost. But as the PR shows, doing "nothing" isn't an option, at least when, like on x86 there's both SSE and AVX variants and the surrounding code would make the SSE variant (appear) cheaper. Any good ideas? Otherwise I'll try to extensively cover all libm builtins (anticipating future SIMD-ification) in the same way, with same costs. Thanks, Richard. PR target/125174 * config/i386/i386.cc (ix86_vector_costs::add_stmt_cost): Cost calls as 10 times FMA. --- gcc/config/i386/i386.cc | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index e73c2d7f7d0..6b271ac3fca 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -26602,6 +26602,13 @@ ix86_vector_costs::add_stmt_cost (int count, vect_cost_for_stmt kind, case CFN_MULH: stmt_cost = ix86_multiplication_cost (ix86_cost, mode); break; + CASE_CFN_SIN: + CASE_CFN_COS: + CASE_CFN_EXP: + stmt_cost = 10 * ix86_vec_cost (mode, + mode == SFmode ? ix86_cost->fmass + : ix86_cost->fmasd); + break; default: break; }