From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id C329C3858D1E for ; Mon, 19 Jun 2023 20:34:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C329C3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 20FB912FC; Mon, 19 Jun 2023 13:34:58 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B59183F59C; Mon, 19 Jun 2023 13:34:13 -0700 (PDT) From: Richard Sandiford To: Jeff Law Mail-Followup-To: Jeff Law ,Richard Biener , gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Cc: Richard Biener , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] tree-optimization/110243 - kill off IVOPTs split_offset References: <20230616123424.B38AC1330B@imap2.suse-dmz.suse.de> Date: Mon, 19 Jun 2023 21:34:12 +0100 In-Reply-To: (Jeff Law's message of "Mon, 19 Jun 2023 12:32:28 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-21.6 required=5.0 tests=BAYES_00,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Jeff Law writes: > On 6/16/23 06:34, Richard Biener via Gcc-patches wrote: >> IVOPTs has strip_offset which suffers from the same issues regarding >> integer overflow that split_constant_offset did but the latter was >> fixed quite some time ago. The following implements strip_offset >> in terms of split_constant_offset, removing the redundant and >> incorrect implementation. >> >> The implementations are not exactly the same, strip_offset relies >> on ptrdiff_tree_p to fend off too large offsets while split_constant_offset >> simply assumes those do not happen and truncates them. By >> the same means strip_offset also handles POLY_INT_CSTs but >> split_constant_offset does not. Massaging the latter to >> behave like strip_offset in those cases might be the way to go? >> >> Bootstrapped and tested on x86_64-unknown-linux-gnu. >> >> Comments? >> >> Thanks, >> Richard. >> >> PR tree-optimization/110243 >> * tree-ssa-loop-ivopts.cc (strip_offset_1): Remove. >> (strip_offset): Make it a wrapper around split_constant_offset. >> >> * gcc.dg/torture/pr110243.c: New testcase. > Your call -- IMHO you know this code far better than I. +1, but LGTM FWIW. I couldn't see anything obvious (and valid) that split_offset_1 handles and split_constant_offset doesn't. Thanks, Richard