From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7E5343857725 for ; Mon, 1 May 2023 06:29:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7E5343857725 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682922563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cfPrZkVe85EeodNXWWvOwoArQM9BSvYC70t9rXWt9pg=; b=TQoBckLVvfUJVYTAVm/A5EqKrdeBvryHh+7AS/L99wvSzNvxEf1b+X0d0v6bi5A/L42fsc 7WP9UmCA9EkAxSlMvGMi5fcPKs1NzWoCbr0Qr9ds1P6k7q6XyZPWTBqQdXsuyxTTNWVCSf zwvZLPhnTR9rcsVfTJwNDqj5awHhbgg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-374-ik9hlgY6Ny6u0bx2fwIb9A-1; Mon, 01 May 2023 02:29:14 -0400 X-MC-Unique: ik9hlgY6Ny6u0bx2fwIb9A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51316858F0E for ; Mon, 1 May 2023 06:29:14 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CACA63F42; Mon, 1 May 2023 06:29:13 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 3416TCK4564885 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 1 May 2023 08:29:12 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 3416TCo3564884; Mon, 1 May 2023 08:29:12 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] Inline irange::set_nonzero. Date: Mon, 1 May 2023 08:29:06 +0200 Message-Id: <20230501062906.564803-12-aldyh@redhat.com> In-Reply-To: <20230501062906.564803-1-aldyh@redhat.com> References: <20230501062906.564803-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: irange::set_nonzero is used everywhere and benefits immensely from inlining. gcc/ChangeLog: * value-range.h (irange::set_nonzero): Inline. --- gcc/value-range.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/gcc/value-range.h b/gcc/value-range.h index 9a834c91b17..5cff50e6d03 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -886,8 +886,24 @@ irange::upper_bound () const inline void irange::set_nonzero (tree type) { - wide_int zero = wi::zero (TYPE_PRECISION (type)); - set (type, zero, zero, VR_ANTI_RANGE); + unsigned prec = TYPE_PRECISION (type); + + if (TYPE_UNSIGNED (type)) + { + m_type = type; + m_kind = VR_RANGE; + m_base[0] = wi::one (prec); + m_base[1] = m_nonzero_mask = wi::minus_one (prec); + m_num_ranges = 1; + + if (flag_checking) + verify_range (); + } + else + { + wide_int zero = wi::zero (prec); + set (type, zero, zero, VR_ANTI_RANGE); + } } // Set value range VR to a ZERO range of type TYPE. -- 2.40.0