From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78952 invoked by alias); 20 May 2019 11:54:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 78842 invoked by uid 89); 20 May 2019 11:54:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-lj1-f195.google.com Received: from mail-lj1-f195.google.com (HELO mail-lj1-f195.google.com) (209.85.208.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 May 2019 11:54:57 +0000 Received: by mail-lj1-f195.google.com with SMTP id j24so12202307ljg.1 for ; Mon, 20 May 2019 04:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ksGM2aI0sQyVlqGCOJycGy/yFJpjDKjA/s947pAt1+0=; b=XX25lCdu6zHcGCM9eIavytEVdSJMZe+KtY8qiH4wkPH+ozDjFcClLiiwy5YRsLDUzo x/wRXjA9UUlIMDiaYmTmUn8zn0efK9nx7n/kpR6lNm9i5QgL5OioSVkOJkDW3hTdfFnA Y7OL3XOvLRjSSD+vTWMFFN3F7KghOs7R2v0Zmf/U4cR2axF6ph69zj5vi1bFuIGzvDlx ISZnv0GDAch4E0rWUv4el2FbcTa9gg9TVWNq0+9bXdUDZrE0yZTQMnNbS1PEExxco8vN rPnrkjTBXV7STKL+dwnASRFJQXMBOMmd92+as9NcowJNL95AMQKrltySU7C44WdHC/MI +ujA== MIME-Version: 1.0 References: <334e4382-d393-4a83-0fa6-abd80a949f44@redhat.com> In-Reply-To: From: Richard Biener Date: Mon, 20 May 2019 11:54:00 -0000 Message-ID: Subject: Re: [PATCH] Remove empty loop with assumed finiteness (PR tree-optimization/89713) To: Feng Xue OS Cc: "gcc-patches@gcc.gnu.org" , Jeff Law Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg01238.txt.bz2 On Mon, May 20, 2019 at 11:48 AM Feng Xue OS wrote: > > >> Now finiteness assertion is only used in a very late CD-DCE, which is located after all loop optimizations are done. And we can even place it as late as just before RTL-expansion. This might be safe enough to let hidden infinite loops exposed. > > > > Is that so? The early pipeline contains a CD-DCE pass as well. Note we also > > have pure/const discovery affected by this. > > I specialized a CD-DCE pass, named CD-DCE2, and only in this pass, loop removal based on assumed finteness is performed. Please check the patch. Oh, but why not generally do this? > >> Now we still need to define "non-trivial exit condition" and a way to > actually test for that. > > Still not very clear on "non-trival exit condition". I think if a loop contains non-EH exit, it is terminable. Possibly, but that's not terminology for user-facing documentation ;) I'd even say if a loop contains an exit it is terminable (remove the non-EH qualification). Richard. > Feng > >