From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 214473858D28 for ; Fri, 11 Aug 2023 14:00:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 214473858D28 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-pl1-x62f.google.com with SMTP id d9443c01a7336-1bc63ef9959so17732795ad.2 for ; Fri, 11 Aug 2023 07:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691762415; x=1692367215; 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=CuaYf1z1GlM9aDZosGrltKE4LL2j28WGeK38bXkcZdo=; b=cxbqh0+272xUazpQgDVpAJLk7isPiYRkXiMLE9dvRQHOXTnOcR7BrHzMTrexm3TqRj h7KeN++WprlSRMbH+WwuPsLdiE4c749YF+gUHXZJPUTQRcCkNKt2ZfXiPwz/1htoa9jE zVbDndgkOxAze5wSbAowYcPx8CG+6uXHkwVR8Okrm4kY+hq5mjpwn2xcX3kJR7jCXHI/ EDUXm2JWip1T8x1kllz2E8tAjZw94N/juUqoFmTx2Q5iNUHfwPQG4v9cDXesT2YVY3tL cJWlWP2CDBmsFfsTBsoUE9Z7RCKXbwiSK9JTXTrnlVZr0fv2DPtCXo82WdSreO05vLW5 zhwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691762415; x=1692367215; 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=CuaYf1z1GlM9aDZosGrltKE4LL2j28WGeK38bXkcZdo=; b=CHqUHDYJl2FTfWwaNnxPibY4AJJpkPN9HiWZ0kAPIjwydpjIILsu1NywsOJ0Kj5WQ9 KiMU5fD2uzgvI7C2xECI6VZLx3S6uOmjp9y1ZQGJajHy/2siuDe+Ti+kXpJYEtSUSOhL yc8TCFFxu0PpkZfvQRXV5h3MeVR2EL2FuxlqsUbUL8Ha/5p1lF9ep9x9uUFhkJWG9xLB ZOXa2t1rD0Y0NhmwULbTyulUO3m9Ookb49nH/PGIg0Sy6VlNbCzRWxwiauZMSchs3IPZ Tusjk/YpN6bVSsRV5QfHjFja5eqer/OS7Tzntmp746bh6uahyIMv4cPpjMLDHc1KeTIq XZxg== X-Gm-Message-State: AOJu0YzfoqOc8xXUQ+NTEacXmSCUMh4yLXCRAhGRDZlFuXwaXGLVmBHf DRY+dQgLICa1tODlija2JZA= X-Google-Smtp-Source: AGHT+IHpaCfoZpu8iuabuphZvhnZAg7YN6kG5txtMBjSimXA3m5Th7BiTxY9g0MlHWzKvYsImC4Iaw== X-Received: by 2002:a17:903:4d:b0:1b9:e23a:f761 with SMTP id l13-20020a170903004d00b001b9e23af761mr1815906pla.63.1691762414900; Fri, 11 Aug 2023 07:00:14 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id jf7-20020a170903268700b001b9f032bb3dsm3954684plb.3.2023.08.11.07.00.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Aug 2023 07:00:14 -0700 (PDT) Message-ID: Date: Fri, 11 Aug 2023 08:00:13 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 2/2] VR-VALUES: Rewrite test_for_singularity using range_op_handler Content-Language: en-US To: Richard Biener , Andrew Pinski , Andrew MacLeod , Aldy Hernandez Cc: gcc-patches@gcc.gnu.org References: <20230811091551.2758227-1-apinski@marvell.com> <20230811091551.2758227-2-apinski@marvell.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=-2.8 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 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 8/11/23 03:51, Richard Biener via Gcc-patches wrote: > On Fri, Aug 11, 2023 at 11:17 AM Andrew Pinski via Gcc-patches > wrote: >> >> So it turns out there was a simplier way of starting to >> improve VRP to start to fix PR 110131, PR 108360, and PR 108397. >> That was rewrite test_for_singularity to use range_op_handler >> and Value_Range. >> >> This patch implements that and >> >> OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. > > I'm hoping Andrew/Aldy can have a look here. It's actually pretty simple stuff. Instead of open-coding range identification for op1 and simplification of that range using op0's known range (VR), instead we generate a real range for op1 and intersect that result with the known range for op0. If the result is a singleton, return it. Simpler and more effective in the end. I guess the interactions with the warning subsystem are a non-issue in the updated code since it doesn't return an expression, but the singleton value (when in the hell did it start returning an expression, that just seems wrong given the result is supposed to be a singleton!) LGTM. Jeff