From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 7C98A3858D32 for ; Sat, 3 Jun 2023 17:17:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C98A3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-652a6cf1918so1362141b3a.1 for ; Sat, 03 Jun 2023 10:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685812636; x=1688404636; 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=ARRRrIUcn/2+kc4+++WCHAc4ojNYXDQ10aerBn8UQfE=; b=pYR6lpfA11QOLTusHh6A6UtzSCm4kADt2irIYFhNmvTF0A43KHBJlYzArAgIcLef2e oFjSakMAdHn+CZKOzirs8qt2rZ1inDW4d4Cy45sSUIk9coM86Xl/d7hWp9QUKJ3B+qjD IFEdPVuADhmLCihcypnU1AhrbO0WwgTVzmMwtsPu8HmKL/Ic41ayzAhbBPIWhUA0QNLn 6ax8YLfsUe3IAXI/koEppYowqRd1dq0k4iE0Unah5sbpOO63QEu1R17+qLchsvdF366K +iASx2KFqNInZXzV9AQP8q1Gw2VzuZmHUhQtNkjB0fg/Ydw+Et4qFpr4qyC8EyNoh5mB 9c8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685812636; x=1688404636; 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=ARRRrIUcn/2+kc4+++WCHAc4ojNYXDQ10aerBn8UQfE=; b=k/BIZHXiSLLcJXFXWnsMCibRtDJWcFeOY9WklG2ojIQNz/rYMZTv7jaxe6mvyq10C3 Sb3M8+YuXDBjPkTlLqZ1cbp0HJjxNetJsRU3SYrLTlezgO1XfMICssy3KM1TPuAbX/N/ yVNyzS/JdHQl13vFDtnm3Z/kAOmQEP9dxevO/dfZYPHlRTrwldf+PVA/AsNQhAEvgaSV xJUWHIubIC8Xc/aJl/O/p0cI8RiGxv1CDfn3egTwUcA8QobLQPbNm8f5RoS0UirDM4uM GshhgbTPOdpYDecwzD9DSSVvpXyA/W6GPaSwR16gfTRS+9Ry7oi+AzsBWflY9EdjVeKo 6Tyg== X-Gm-Message-State: AC+VfDzU/xLAa9ehb1EwJDPlkxLFYVx8FfXWSB4DIv/BiMYV9PFAL7Uu mseoVLT/gL/X1B7pdJ62u2Q= X-Google-Smtp-Source: ACHHUZ4SC7Iap4OVD0Vyhq8rBC/7w79+8SqVzy1nTWQ2NtcDy41oIF64qTolDQfMMfA86r1rjzCsCw== X-Received: by 2002:a05:6a20:4415:b0:ff:a820:e060 with SMTP id ce21-20020a056a20441500b000ffa820e060mr965806pzb.20.1685812636218; Sat, 03 Jun 2023 10:17:16 -0700 (PDT) Received: from ?IPV6:2607:fb90:469:b40a:c15c:6a92:5516:c5a5? ([2607:fb90:469:b40a:c15c:6a92:5516:c5a5]) by smtp.gmail.com with ESMTPSA id d12-20020a170903230c00b001a6dc4f4a8csm3465735plh.73.2023.06.03.10.17.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 03 Jun 2023 10:17:15 -0700 (PDT) Message-ID: <2e3a44c5-9f63-d4ba-af93-8da30ffff309@gmail.com> Date: Sat, 3 Jun 2023 11:17:13 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] reload_cse_move2add: Handle trivial single_set:s Content-Language: en-US To: Hans-Peter Nilsson , gcc-patches@gcc.gnu.org References: <20230531151322.4CE832041F@pchp3.se.axis.com> From: Jeff Law In-Reply-To: <20230531151322.4CE832041F@pchp3.se.axis.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: On 5/31/23 09:13, Hans-Peter Nilsson via Gcc-patches wrote: > Tested cris-elf, bootstrapped & checked native > x86_64-pc-linux-gnu for good measure. Ok to commit? > > If it wasn't for there already being an auto_inc_dec pass, > this looks like a good place to put it, considering the > framework data. (BTW, current auto-inc-dec generation is so > poor that you can replace half of what auto_inc_dec does > with a few peephole2s.) Actually a better way to do this stuff is to use the PRE/LCM framework. Either Muchnick or Morgan discusses it in their book. > > brgds, H-P > > -- >8 -- > The reload_cse_move2add part of "postreload" handled only > insns whose PATTERN was a SET. That excludes insns that > e.g. clobber a flags register, which it does only for > "simplicity". The patch extends the "simplicity" to most > single_set insns. For a subset of those insns there's still > an assumption; that the single_set of a PARALLEL insn is the > first element in the PARALLEL. If the assumption fails, > it's no biggie; the optimization just isn't performed. > Don't let the name deceive you, this optimization doesn't > hit often, but as often (or as rarely) for LRA as for reload > at least on e.g. cris-elf where the biggest effect was seen > in reducing repeated addresses in copies from fixed-address > arrays, like in gcc.c-torture/compile/pr78694.c. > > * postreload.cc (move2add_use_add2_insn): Handle > trivial single_sets. Rename variable PAT to SET. > (move2add_use_add3_insn, reload_cse_move2add): Similar. OK jeff