From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id B15183858D28 for ; Sat, 4 Mar 2023 22:18:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B15183858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 324MHpVV005795; Sat, 4 Mar 2023 16:17:51 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 324MHo9c005794; Sat, 4 Mar 2023 16:17:50 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Sat, 4 Mar 2023 16:17:49 -0600 From: Segher Boessenkool To: Roger Sayle Cc: "'GCC Patches'" , "'Tamar Christina'" , "'Richard Sandiford'" Subject: Re: [PATCH] PR rtl-optimization/106594: Preserve zero_extend in combine when cheap. Message-ID: <20230304221749.GK25951@gate.crashing.org> References: <000c01d94ec7$a6921430$f3b63c90$@nextmovesoftware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000c01d94ec7$a6921430$f3b63c90$@nextmovesoftware.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP 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: On Sat, Mar 04, 2023 at 06:32:15PM -0000, Roger Sayle wrote: > This patch addresses PR rtl-optimization/106594, a P1 performance > regression affecting aarch64. > > This patch has been tested on x86_64-pc-linux-gnu with make bootstrap > and make -k check, both with and without --target_board=unix{-m32}, > with no new failures. It should be tested for performance everywhere else, too. It can very easily result in worse code on some targets. This kind of thing really should be done in stage 1, not stage 4. > PR rtl-optimization/106594 > * combine.cc (expand_compound_operation): Don't expand/transform > ZERO_EXTEND or SIGN_EXTEND on targets where rtx_cost claims they are > cheap. That is not how combine works. If the old code is more expensive than what combine comes up with., it *should* transform it. Magic cost cutoffs are not okay anywhere in combine, either. If expand_compound_operation and friends misbehave (not really an "if", unfortunately), then please fix that, instead of randomly disabling parts of combine? Segher