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 CD9BA3858CDA for ; Thu, 18 Aug 2022 07:26:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CD9BA3858CDA Received: from mail-oa1-f71.google.com (mail-oa1-f71.google.com [209.85.160.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-478-LMOxeSmHOx-bSAkf3UU5tQ-1; Thu, 18 Aug 2022 03:26:12 -0400 X-MC-Unique: LMOxeSmHOx-bSAkf3UU5tQ-1 Received: by mail-oa1-f71.google.com with SMTP id 586e51a60fabf-10e6ab61e79so457702fac.3 for ; Thu, 18 Aug 2022 00:26:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=sT1dGaAo9eMgd2Zu26WC2N3xiN1f1O1Omb1neMcNLm8=; b=LBrynLYMLAAYpclOiuv56nEmU5w+BPY6bOesu2iZZQMP8vELJU1+lvqChzE5lz4xjm l14JB8MwbQ3h/6cB0X6TcRNM6UQejVKlXkNkKk01WTZVE8wPgK/WyCgEUcbfqQiSfi9t GcX8vvGZi1+H2SDzwlt3OG/gOlt0IAWcONFSXZ9cdhKYjh86ezJV4X9TyTygeMwWrv+E YWeKuFw+MGo9JT4E0O1WEVDcwIpEbQ4apfJtuYCRwbBq5SuA22IX78789yQNOsQX+rSC phCNJCYYYnFTKvskTnZbFKmLK+4njPch0IaTakzT9KkbPmDK883RH57QKAMGfNKJGgCR HrBg== X-Gm-Message-State: ACgBeo1wJx9yCSNWZVcUYNwBfRd6DHeSnuDwb9eanGKf6EoAXwgGBtFJ iGCSj8YoIsGQFpEr0hysIn4gGEVOcR1LG2VngEJ2Qo0gZkH/7vqQt4frpRTupOPfFF5cmlk+mGt rXheqyWorWf4RPmMJjj8NiiXTLdWjNaoZAQ== X-Received: by 2002:a05:6808:f0f:b0:343:2e0e:ac52 with SMTP id m15-20020a0568080f0f00b003432e0eac52mr3133796oiw.36.1660807571462; Thu, 18 Aug 2022 00:26:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR7XCMywjUaFtkVB43ZSRBaNjWF08NJdxKCc/tcQp7tuTtOfdvkK4zccdaSkHBspfVxezdB1+3wljnP/ns4y55E= X-Received: by 2002:a05:6808:f0f:b0:343:2e0e:ac52 with SMTP id m15-20020a0568080f0f00b003432e0eac52mr3133791oiw.36.1660807571222; Thu, 18 Aug 2022 00:26:11 -0700 (PDT) MIME-Version: 1.0 References: <73820.122081107421800679@us-mta-533.us.mimecast.lan> <44b14867-3e77-6029-737e-386aa30d4b4f@redhat.com> <020dfac2-48c1-924d-d3b6-9693e795e625@redhat.com> In-Reply-To: <020dfac2-48c1-924d-d3b6-9693e795e625@redhat.com> From: Aldy Hernandez Date: Thu, 18 Aug 2022 09:26:00 +0200 Message-ID: Subject: Re: [COMMITTED] Abstract interesting ssa-names from GORI. To: Andrew MacLeod Cc: Richard Biener , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-5.4 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, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2022 07:26:15 -0000 Thanks. Pushed. On Wed, Aug 17, 2022 at 3:18 AM Andrew MacLeod wrote: > > > On 8/16/22 21:16, Andrew MacLeod wrote: > > > > On 8/16/22 04:21, Aldy Hernandez wrote: > >> On Thu, Aug 11, 2022 at 1:42 PM Richard Biener > >> wrote: > >> > >>> @@ -599,6 +592,30 @@ path_range_query::compute_imports (bitmap > >>> imports, const vec &path) > >>> worklist.safe_push (arg); > >>> } > >>> } > >>> + else if (gassign *ass = dyn_cast (def_stmt)) > >>> + { > >>> + tree ssa[3]; > >>> + if (range_op_handler (ass)) > >>> + { > >>> + ssa[0] = gimple_range_ssa_p (gimple_range_operand1 > >>> (ass)); > >>> + ssa[1] = gimple_range_ssa_p (gimple_range_operand2 > >>> (ass)); > >>> + ssa[2] = NULL_TREE; > >>> + } > >>> + else if (gimple_assign_rhs_code (ass) == COND_EXPR) > >>> + { > >>> + ssa[0] = gimple_range_ssa_p (gimple_assign_rhs1 (ass)); > >>> + ssa[1] = gimple_range_ssa_p (gimple_assign_rhs2 (ass)); > >>> + ssa[2] = gimple_range_ssa_p (gimple_assign_rhs3 (ass)); > >>> + } > >>> + else > >>> + continue; > >>> + for (unsigned j = 0; j < 3; ++j) > >>> + { > >>> + tree rhs = ssa[j]; > >>> + if (rhs && add_to_imports (rhs, imports)) > >>> + worklist.safe_push (rhs); > >>> + } > >>> + } > >> We seem to have 3 copies of this copy now: this one, the > >> threadbackward one, and the original one. > >> > >> Could we abstract this somehow? > >> > >> Aldy > >> > > > > This particular code sequence processing range-ops and COND_EXPR is > > becoming more common, so I've abstracted it into a routine. > > > > Basically, pass it a vector and the stmt, and it will fill the first X > > elements with ssa-names from the stmt. It only deals with range-ops > > and COND_EXPR for now, and it requires you pass it enough elements (3) > > so that it doesn't have to check if its overflowing the bounds. It > > returns the number of names it put in the vector. > > > > This patch changes GORI to use the new routine. Bootstrapped on > > x86_64-pc-linux-gnu with no regressions. Pushed. > > > > > > Andrew > > > This patch converts the code sequence you complained about to use the > new routine. Check to make sure it doesnt affect the nuber of threads, > it should bootstrap and pass regressions, but I have run out of time > today. Give it a go, and if there was another place you saw this, > change it there too. I didn't find another place. > > Andrew