From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by sourceware.org (Postfix) with ESMTPS id 142133858D33 for ; Thu, 18 Jan 2024 16:24:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 142133858D33 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 142133858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d32 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705595049; cv=none; b=DLHBJMdcZLlkDdqtKx+EJX5vZX+crUhoMzcpMsXaYzrtqkk+Zs8i0s7OGfFEhQyjoSWLUyDhbXG2q9au69VSm0DGbM0VeU3g5bD/Y+PYOPMycE7lZxC9GOynL1aCe8R6vSb4s9kSc1UcG+3GOoUZbEFLfmI0Lm51w+ZsJWXPj3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705595049; c=relaxed/simple; bh=j/myVwUrmAt+uygwRMoUyJJTkvKCSwf45UPTcBmrOeI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=DREbnLqOhYSpeSOSqZiWRIgqJWSZBFEooHQyULpA9lO/QE6MLhuDP+QqDpPBqTmYlnp/ZkNJOghvMCCFNC6lPGLpedDkn5ieN2ndUTJopdJCbjX3Klzd8JhAy/8iibf0J+ihu2MgJjoy6n6kWDjXQWlx4dLKPqdcytPF9pAoUUQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7bed9f5d35dso349782839f.3 for ; Thu, 18 Jan 2024 08:24:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705595047; x=1706199847; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jWBeDoXCJ6YVsdXJVrPNjE2Ad2NqkpnSZlugAehT8G4=; b=lN3CSojKXcX06j5QiRrn63BHSz+oRJp9M9N8cxNSt0W/Ifzq2oLC1wa4RZTNXpbUk1 gdlUiGnR9YfE5L5/E2CWjNxOgKiHx4HwdjV4spAcNslZ7LurufhCu11i1IFjQb2skS29 QW8rEzgCO9w+POnbJGDnhCil/cehGNzBUHeGg6WJXxIoUMY1e28NVK8EOHcAzgOnAQpF 2MpYj7um9ruwVlo2a9ogtGyvtslAe/NJv5DjH8jJ+m26H/pLqvk+FM72539cligYbVR3 qcJcOS9B9eFvRssaSbfoAhscqdSMcW/u2gtboq4TkXmB7wnlG0pA9o3eOb200yp9tfpZ Iliw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705595047; x=1706199847; h=content-transfer-encoding:in-reply-to:from:references:cc: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=jWBeDoXCJ6YVsdXJVrPNjE2Ad2NqkpnSZlugAehT8G4=; b=URi+WXZnnN1DcKUt7fzq1Sr8oXmN2w+yBi3W56ejcoS2K9mP0+OC30St7vVfDyoLMg 3U1b5jIsPaJqXtGRioKyUklWPUyDKX8SwLYu+wa35PLwjYXf+Bzllxms1p9xkVyc6iQ6 oNlIJx8CRGdN8GEl9EZJyb4Q5CEoYrAvIogHH1GBz2lFxvPPnkQnNq3/TRo25e93RsOR 6aVgRWL2i74TG+gM3VaBQbwmO6l0JX3RLdXq4fABn7IMJXOUsnECRQ6KwdIih5WgVot0 StviHZ3g1kzM2UkNLOtFrVY3YhBP52tkh7jnQyzuPf4tzyGWYdjuGFZXKAaEwImCQwQs 3ZXA== X-Gm-Message-State: AOJu0Yw1ACKfuhWNPDnJmOOxOGIIsjW8pdnL3g+vdA1dUF4aKNtHSBfu O2osskmfb95JB3vXI8KzlyipDbVI8mBKRS9ArsRe9h5HNat7eRiJ X-Google-Smtp-Source: AGHT+IH/GYmMFxQ072+R0T5soxRIvsnpR33iCTpZY1VhcEE2xGOBgPhbwtf2MwN/lJMTF0FrHpD7DA== X-Received: by 2002:a05:6602:3413:b0:7bf:5cd0:7cf6 with SMTP id n19-20020a056602341300b007bf5cd07cf6mr1474293ioz.22.1705595047110; Thu, 18 Jan 2024 08:24:07 -0800 (PST) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id da13-20020a0566384a4d00b0046ce54fea8bsm1023024jab.131.2024.01.18.08.24.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jan 2024 08:24:06 -0800 (PST) Message-ID: Date: Thu, 18 Jan 2024 09:24:05 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] combine: Don't optimize SIGN_EXTEND of MEM on WORD_REGISTER_OPERATIONS targets [PR113010] Content-Language: en-US To: Greg McGary , Richard Biener Cc: gcc-patches@gcc.gnu.org References: <20240116221914.267015-1-gkm@rivosinc.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: On 1/17/24 20:53, Greg McGary wrote: > On Tue, Jan 16, 2024 at 11:44 PM Richard Biener > > wrote: > > > On Tue, Jan 16, 2024 at 11:20 PM Greg McGary > wrote: > > > > > > > > The sign bit of a sign-extending load cannot be known until runtime, > > > > so don't attempt to simplify it in the combiner. > > > > > It feels like this papers over an issue downstream? > > While the code comment is true, perhaps it obscures the primary intent, > which is recognition that the pattern (SIGN_EXTEND (mem ...) ) is destined > to expand into a single memory-load instruction and no simplification is > possible, so why waste time with further analysis or transformation? There > are plenty of other conditions that also short circuit to "do nothing" and > this seems just as straightforward as those others. Efforts to catch this > further downstream add gratuitous complexity. Because the real bug is likely still lurking, waiting for something else to trigger it. An early exit is fine when we're just trying to avoid unnecessary work, but there's something else going on here we need to understand first. jeff