From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id D15B23858CDA for ; Tue, 24 Oct 2023 17:24:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D15B23858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D15B23858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::530 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698168251; cv=none; b=vCXfrvRjaWR/AaTRSAGDMKizlQD0vkVQlae7cz8Z60LugLf6B2fYxtQIGcUj62pAqNa7LQAz2HMbXP1sthcQPYWaBsqjgfMsGMRb/k/yVjUVufeR3ir7cx5KNVi/yXa6tU+FMwpt2XRcalA+P3cNh2g4rHPWRcyms/XrEch04mM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698168251; c=relaxed/simple; bh=gMUDgCXnqtuoOjFPuzmubl38t7/TuHVcHRcfWVzFIIg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=j/7iCOxXJbZSZw7lWNDwXeYZsL2RtmgXeOHb2IcivDh12FUqKqbkO0PYepMscMB0avZNObXT5wbbb9aHqNYmNOkMqS1Cha/dvFKDwEbDFhwDFTEbAkExgiBoop+F45BM4BGbLPT9mUhs/7q+DR94N820uB6Hl0cSfQvmqxfrHqs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5a9bc2ec556so2985643a12.0 for ; Tue, 24 Oct 2023 10:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698168249; x=1698773049; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=aqTjjLaGdRK9Ex4wXYRTpfk2d/uLWUo86E0vzN6T5Kw=; b=KsfRK/kFBY0yd1JbqgfDbPnpEfZxj8IWF1yLKa043G0LOI/BAaEx+o3jk3zbrBUTR1 2jdLpUQ7CFZ/p3ehcsapWW2ejScYGloxYdAUOAY6Yx3rO/QLkA7KF+gl3hVA8cb3Lffp omFYH/9KoeHooIPeCSw31xYXeurbZHOxRc+9NBTg22VA77OIhkVBjD5f0tuWHsvfTKW1 O8iinKuZYOP3Qxm9kpRgezcvwfivM97yjrHd/5txRwoejuxaltCtrDFU9RwWY9se/rCZ nGOImctq3oKeRAvkDtj6HD+yVYCSO6tGPGCXrejl6yAFAfxlJPA9Y5t/k4iLzuZNKY6h of3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698168249; x=1698773049; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aqTjjLaGdRK9Ex4wXYRTpfk2d/uLWUo86E0vzN6T5Kw=; b=eH0W9Zx00PH288Pl+5ts5hix6el4zR/7PKy5S4ASc1Eu5vLK0T3Hh6Y0g38fj2h3G3 BR/26R7MDBVm0ASuAILf9mYipArtVJDWgAK4jpllmbasDGxnEdaGCnsfiXaIPfpPPSS1 lA1d+J7g1eqQa1Saz9767Pq0RnfoMk4ZlxTLH+9UZFcbd34hIdpMdvXk5pVnQmOD0BGy 0xJRZXhbOAYoliW6nV4kb8gkiMOLq6uXUXj7u/+ZlJTM27E0LUDSpeZ6cwF9aGZ/MsjP CArCWsRc9l5v+UEn2bZtJss1AWNZeLzVRgEde4UvZWd0gTj6wsWOSFU0LyOmrKaNuVkn IuvQ== X-Gm-Message-State: AOJu0YyYkFo07602dITa21cMsArH/+Bygg26jS0HnwylsMnTcCqnG28G bLBHMZ11ab89WgV4/FLcq4sQ2or1cx8= X-Google-Smtp-Source: AGHT+IFXg/BcnTm7/X2Q1lakiKjWpwIaAAJR4FMe0CSerZM66SYNQH7el+c7ZEWkrN3fPpB0O+NaRQ== X-Received: by 2002:a05:6a20:e120:b0:16b:8498:7d29 with SMTP id kr32-20020a056a20e12000b0016b84987d29mr3877111pzb.27.1698168248733; Tue, 24 Oct 2023 10:24:08 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id y92-20020a17090a53e500b00274e3e5f334sm1283983pjh.0.2023.10.24.10.24.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Oct 2023 10:24:08 -0700 (PDT) Message-ID: <9f7afde6-ab1f-495a-a3c3-3a3948104c1f@gmail.com> Date: Tue, 24 Oct 2023 11:24:06 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/6] rtl-ssa: Fix ICE when deleting memory clobbers Content-Language: en-US To: Richard Sandiford , jlaw@ventanamicro.com, gcc-patches@gcc.gnu.org References: <20231024105006.3337671-1-richard.sandiford@arm.com> <20231024105006.3337671-4-richard.sandiford@arm.com> From: Jeff Law In-Reply-To: <20231024105006.3337671-4-richard.sandiford@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 List-Id: On 10/24/23 04:50, Richard Sandiford wrote: > Sometimes an optimisation can remove a clobber of scratch registers > or scratch memory. We then need to update the DU chains to reflect > the removed clobber. > > For registers this isn't a problem. Clobbers of registers are just > momentary blips in the register's lifetime. They act as a barrier for > moving uses later or defs earlier, but otherwise they have no effect on > the semantics of other instructions. Removing a clobber is therefore a > cheap, local operation. > > In contrast, clobbers of memory are modelled as full sets. > This is because (a) a clobber of memory does not invalidate > *all* memory and (b) it's a common idiom to use (clobber (mem ...)) > in stack barriers. But removing a set and redirecting all uses > to a different set is a linear operation. Doing it for potentially > every optimisation could lead to quadratic behaviour. > > This patch therefore refrains from removing sets of memory that appear > to be redundant. There's an opportunity to clean this up in linear time > at the end of the pass, but as things stand, nothing would benefit from > that. > > This is also a very rare event. Usually we should try to optimise the > insn before the scratch memory has been allocated. > > gcc/ > * rtl-ssa/changes.cc (function_info::finalize_new_accesses): > If a change describes a set of memory, ensure that that set > is kept, regardless of the insn pattern. OK jeff