From patchwork Tue Sep 24 13:20:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1988963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.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=vyoerz+J; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=euLt+OMy; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=vyoerz+J; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=euLt+OMy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XCgV31htnz1xst for ; Tue, 24 Sep 2024 23:20:59 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A32B63858CD1 for ; Tue, 24 Sep 2024 13:20:56 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id ACD0B3858D20 for ; Tue, 24 Sep 2024 13:20:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACD0B3858D20 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 ACD0B3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727184036; cv=none; b=kEyAw4Ugx0F12eebom+leRhHpvPL6vU6BELQjjU7Xm+9hLkaRfIizhKBYkist2owTN2xPRULiBQMXbLWDEKXgOhQCo6tGcPLrv/cxrwEgEVWxYo4HznvlXKlMZqmicAJzOZ90TDpzcO2RCLRxLVqnuYT/OiOoNZlOfHgtyRgR0Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727184036; c=relaxed/simple; bh=1YJHaHwS4h9je6bXTCyu3hUkeHxEde4G2ppPlA0J7P8=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version; b=QO+MsYHpqXiQl8JeY3WB5IqUBx99MKiR8gdSmkK/xuFoqZmjQKXs3XNSxUTu2D/g7oASw4Dw3QP5WoLLhqjvm0nQjKQiSuEcF3tfgurXR5wq+ZkIlhbhgiojszLyaaXfJvlLyHWdjKRJ7iieoqsBfTltXKpzk7d+PaVHA27vIdQ= ARC-Authentication-Results: i=1; server2.sourceware.org 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-out1.suse.de (Postfix) with ESMTPS id AA7CF21AEE for ; Tue, 24 Sep 2024 13:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727184033; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=i3TIST5w6eVh+8mrTsUHLJ+feMuMk9dm/d5DqJ/JzVY=; b=vyoerz+JoLqIMRbTOy0dwZbrlRpCixOSY7/cD6100nFHmHabHIz/6TsHmD+uNno7MKyOQF L1flni3YRhm8gtNaPJ7TCCvD15Kfuw1U374bMpX3MgDQkD/C5lJ6DLTpu610Umn3kJCUlH xz9J3T4N9riFYT+xvQSmmdv1XIN/1jo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727184033; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=i3TIST5w6eVh+8mrTsUHLJ+feMuMk9dm/d5DqJ/JzVY=; b=euLt+OMyUDUlWITaS9UO6Iy2i9815SQyAWZliyuVoNaFRfU3n29dSHTvXPIVj0UxM9+5oR k12wPt7bFmd0zCAA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727184033; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=i3TIST5w6eVh+8mrTsUHLJ+feMuMk9dm/d5DqJ/JzVY=; b=vyoerz+JoLqIMRbTOy0dwZbrlRpCixOSY7/cD6100nFHmHabHIz/6TsHmD+uNno7MKyOQF L1flni3YRhm8gtNaPJ7TCCvD15Kfuw1U374bMpX3MgDQkD/C5lJ6DLTpu610Umn3kJCUlH xz9J3T4N9riFYT+xvQSmmdv1XIN/1jo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727184033; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=i3TIST5w6eVh+8mrTsUHLJ+feMuMk9dm/d5DqJ/JzVY=; b=euLt+OMyUDUlWITaS9UO6Iy2i9815SQyAWZliyuVoNaFRfU3n29dSHTvXPIVj0UxM9+5oR k12wPt7bFmd0zCAA== Date: Tue, 24 Sep 2024 15:20:33 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Simplify range-op shift mask generation MIME-Version: 1.0 X-Spam-Score: -1.14 X-Spamd-Result: default: False [-1.14 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MISSING_MID(2.50)[]; NEURAL_HAM_LONG(-0.34)[-0.345]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_ZERO(0.00)[0]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[murzim.nue2.suse.org:helo] X-Spam-Level: X-Spam-Status: No, score=-10.6 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Message-Id: <20240924132056.A32B63858CD1@sourceware.org> The following reduces the number of wide_ints built which show up in the profile for PR114855 as the largest remaining bit at -O1. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * range-op.cc (operator_rshift::op1_range): Use wi::mask instead of shift and not. --- gcc/range-op.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/range-op.cc b/gcc/range-op.cc index c576f688221..3f5cf083440 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -2863,7 +2863,7 @@ operator_rshift::op1_range (irange &r, // OP1 is anything from 0011 1000 to 0011 1111. That is, a // range from LHS<<3 plus a mask of the 3 bits we shifted on the // right hand side (0x07). - wide_int mask = wi::bit_not (wi::lshift (wi::minus_one (prec), shift)); + wide_int mask = wi::mask (shift.to_uhwi (), false, prec); int_range_max mask_range (type, wi::zero (TYPE_PRECISION (type)), mask);