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 63B933858297 for ; Tue, 4 Oct 2022 11:28:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 63B933858297 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=1664882913; 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=UqZMxaKg0fTaJ+XLuKFM0nQYd93SQ/ZTXfVy7xBeFgE=; b=G+DC/prbyC5/RXv3e2IuRnvDcrsy0i0cB/+UocEkpWwdiKu6BZCrMNf0o1ZbSq97WwsXdl 3vKXFtoK9xt2CVPWbMcmXUtksNUtB3+R0oJcshBGNtAe2k9DfDrJxlagtpS/BjhpEjSpjS a5EaYyh1iLWY9n8cl1BQ3j1hwEh7so4= Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-126-DySUXD_KPWKNBpFs5U6Z_A-1; Tue, 04 Oct 2022 07:28:31 -0400 X-MC-Unique: DySUXD_KPWKNBpFs5U6Z_A-1 Received: by mail-oi1-f199.google.com with SMTP id f16-20020a05680814d000b003506268b99fso5079969oiw.2 for ; Tue, 04 Oct 2022 04:28:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=UqZMxaKg0fTaJ+XLuKFM0nQYd93SQ/ZTXfVy7xBeFgE=; b=ZSDqFrKiQCCx1KjBvdDsBkwqVWWUre66UiZM+5f+3ieuoIB2j5wfWoh4RfIypK6nCx u2888o+maqe4SQqAkQw61DPSobLzhZYVlz8gwjQWEc1Rj92AbYRnRh95k4R12N42IJpx KF9djPM24c3lhTZ7oNVIOSdzBeCKJeJrvPHiBAy0pYg2hGmDRbSwuDsndPaPH7qYf663 ekZMFnYcJgO8+1V3I3LPPbiHHEMzfjSTf5gZ73lEbRV722kfvLdN0c/F7TkuMiU/hXwc X45Y175gavm7fgRnZNu1EYUYwJ7i0Al6tP3/wT6hAy/SxaSh2aC7Cyawn52Bz1lMNc9L RVQA== X-Gm-Message-State: ACrzQf2FApGDcJkyRfcg2sYX8W9Uuc2ShOOnogLTTOngffB7S/eYNxqi FBzzGupDAz34atUxm1dTjQ14K4/1PhOd5Y354H6sYfFTMiVudB5mB+65J4wbVd6DFHfsT+5sJIf YXj3llwCYsgVQ8Py66FUCen/SsUt/p+R7hA== X-Received: by 2002:a4a:e2d2:0:b0:475:6f34:9590 with SMTP id l18-20020a4ae2d2000000b004756f349590mr9246931oot.30.1664882911146; Tue, 04 Oct 2022 04:28:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Sp+/tJW6w/TMS66r5EO979pxKxzY40jixEK5WHPjAU8AMQSodyQZTep5Eue5H3/yDgJKX0oC4Toe3GC+xCJw= X-Received: by 2002:a4a:e2d2:0:b0:475:6f34:9590 with SMTP id l18-20020a4ae2d2000000b004756f349590mr9246922oot.30.1664882910866; Tue, 04 Oct 2022 04:28:30 -0700 (PDT) MIME-Version: 1.0 References: <20221004073530.1461390-1-aldyh@redhat.com> In-Reply-To: From: Aldy Hernandez Date: Tue, 4 Oct 2022 13:28:19 +0200 Message-ID: Subject: Re: [COMMITTED] Convert nonzero mask in irange to wide_int. To: Richard Biener Cc: GCC patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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 List-Id: On Tue, Oct 4, 2022 at 9:55 AM Richard Biener wrote: > > > Am 04.10.2022 um 09:36 schrieb Aldy Hernandez via Gcc-patches : > > > > =EF=BB=BFThe reason the nonzero mask was kept in a tree was basically i= nertia, > > as everything in irange is a tree. However, there's no need to keep > > it in a tree, as the conversions to and from wide ints are very > > annoying. That, plus special casing NULL masks to be -1 is prone > > to error. > > > > I have not only rewritten all the uses to assume a wide int, but > > have corrected a few places where we weren't propagating the masks, or > > rather pessimizing them to -1. This will become more important in > > upcoming patches where we make better use of the masks. > > > > Performance testing shows a trivial improvement in VRP, as things like > > irange::contains_p() are tied to a tree. Ughh, can't wait for trees in > > iranges to go away. > > You want trailing wide int storage though. A wide_int is quite large. Absolutely, this is only for short term storage. Any time we need long term storage, say global ranges in SSA_NAME_RANGE_INFO, we go through vrange_storage which will stream things in a more memory efficient manner. For irange, vrange_storage will stream all the sub-ranges, including the nonzero bitmask which is the first entry in such storage, as trailing_wide_ints. See irange_storage_slot to see how it lives in GC memory. Aldy