From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 03D6E3858D39 for ; Tue, 19 Sep 2023 13:41:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 03D6E3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695130867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xgonj8md2Jd2A61oZLav9X+8trXCixbaimEAT+nMvO0=; b=TtJSmSuQNa1yUVQkTthDkCTKfyVmJDeD2Aox1CaTsOfmTxgG4pz5713/onGpag65buo45l Xo2knQMTOmaGcBDokCxSi1c6oSCDF9AFrDlZUpHphq/YDGC0I1x+VmWv2w+lALRGllRQBb BvKLpJv+tqirO6fQKvkII7zCekXxuBE= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-127-HSbENGFLO5acXYvaziFZSQ-1; Tue, 19 Sep 2023 09:41:06 -0400 X-MC-Unique: HSbENGFLO5acXYvaziFZSQ-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-76ef92fadefso743052285a.2 for ; Tue, 19 Sep 2023 06:41:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695130865; x=1695735665; 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=xgonj8md2Jd2A61oZLav9X+8trXCixbaimEAT+nMvO0=; b=SEUNRMPmQUYDN5Vuo37l3qECSjxZ11PuoFR6LsXtUk+XBzsLySPqYgAjJDNULg3rf0 wejj1sAaEJddLcdfuLptNeD4DtC6GN2RUCMmcHtbdrDT55GKFgmj7u5yKCAmzUr5X61k dYNQxbBU2iR2iXfJXVhuY975yaB6VvYRdpabVWGWBiBkfdLlf+Qv/Yh35dflB8onAOMy 1IZk9RVMY7LyHT2ylAC1kNtmyRidEogCnAOk4hy0rpbTrN+IJT+AxDo2ejnzdgbvW7z9 zCqjLaGHViO0cLm97Djrp+KFjBwQVMSvM72/Si+Pai2G4u656vUFClcM5tx9N2+Sp/Y+ 76Xg== X-Gm-Message-State: AOJu0YzjVBUANpQl7wQtzIQ4TgvIagxKDf1yfl/JFsOwsCroOnTsI+nS taWjVlEgbZ+HLe1rsETN5SDiQT8fOQcwNh0N7OgOy68/jU43ddjQ0oU8CeAGrGrFUKuOtQIj0JK PEFRjUYnMr8xXgTGzTw== X-Received: by 2002:a05:620a:2682:b0:76c:ea3f:9010 with SMTP id c2-20020a05620a268200b0076cea3f9010mr13442972qkp.16.1695130865594; Tue, 19 Sep 2023 06:41:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUKajYi8K7TRUU+R7L12Ps3Kgif30yVhsNdLyD/+tcbRDG2ngXiCbo49VN0INknHn6VEdcDg== X-Received: by 2002:a05:620a:2682:b0:76c:ea3f:9010 with SMTP id c2-20020a05620a268200b0076cea3f9010mr13442957qkp.16.1695130865324; Tue, 19 Sep 2023 06:41:05 -0700 (PDT) Received: from [192.168.0.174] ([104.219.124.252]) by smtp.gmail.com with ESMTPSA id l11-20020ae9f00b000000b007677347e20asm3939819qkg.129.2023.09.19.06.41.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Sep 2023 06:41:04 -0700 (PDT) Message-ID: Date: Tue, 19 Sep 2023 09:41:06 -0400 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] [RFC] New early __builtin_unreachable processing. To: Richard Biener Cc: gcc-patches , "hernandez, aldy" References: <703c843e-1743-f2d4-4e38-0a52a048725b@redhat.com> From: Andrew MacLeod In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 9/19/23 08:56, Richard Biener wrote: > On Mon, Sep 18, 2023 at 3:48 PM Andrew MacLeod wrote: >> >> OK. >> >> I dont see anything in the early VRP processing now that would allow a >> later pass to remove the unreachable unless it does its own analysis >> like DOM might do. > Isn't it as simple as > > if (i_2 > 5) __builtin_unreachable (); > > registering a global range of [6, INF] for i_2 and then the next time > we fold if (i_2 > 5) using range info will eliminate it? Yes, historically > that required VRP or DOM since nothing else looked at ranges, not > sure how it behaves now given more match.pd patterns do look > at (global) ranges. if we set the range yes.   What I meant was in the cases where we decide it can't be removed, we do NOT set the range globally in vrp1 now. This means  unless some other pass determines the range is [6, +INF] the unreachcable call will remain in the IL and any ranger aware pass will still get the contextual range info resulting from the unreachable.  We were sometimes removing the unreachable without being able to update every affected global/future optimization opportunity, which this fixes. Hopefully :-)   Its certainly much better at least. In theory, if inlining were aware of global ranges and propagated them, we could also now remove these some of these unreachables in EVRP rather than VRP1...   as I think we're now sure there is no benefit to keeping the unreachable call when we remove it. > In any case, thanks for the explanation and OK for the patch. Will check it in shortly. Andrew