From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32309 invoked by alias); 28 May 2019 20:32:09 -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 32300 invoked by uid 89); 28 May 2019 20:32:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-yw1-f66.google.com Received: from mail-yw1-f66.google.com (HELO mail-yw1-f66.google.com) (209.85.161.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 May 2019 20:32:08 +0000 Received: by mail-yw1-f66.google.com with SMTP id b74so51137ywe.5 for ; Tue, 28 May 2019 13:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=DeNTuSvb8EBpNALAu+vbDeNRSFj40i4pwx45BZ14PZE=; b=dPAj+SlaWQAetS9tHRNUIJHaOOepFILS1ngkTQ8D4zECOunflBBeSRKgCm6/5TvsT/ CqKJwyUucoopRgR1wL7pvXt4sjTPd+z2TnSAbg22JvUr1gxirPfkLujdwJTyhmybO8Y+ hMq9c5GPbJvcFBC4euZc50WS0gLuwcidEDVU24EixxT2kf4uoTebiEmQn1qt/T54cMkG BJjmak3oQzJIMzPzlcko7YvoEgddzrFApvLb0kyNkRPUAAitICdbgEduanjqCGUH8nQS qk6CmnOKRKp/MwW400QE3MMssvqwrD9TrByG2WrebXk4IT5dVBQND3H9ZN5RnkO2lYV6 1ygQ== MIME-Version: 1.0 References: <20190524080749.GN19695@tucnak> <1dbe5ead-9c65-4e97-5c94-cfd1f5896ab4@suse.cz> <20190527125045.GW19695@tucnak> In-Reply-To: From: Christophe Lyon Date: Tue, 28 May 2019 20:44:00 -0000 Message-ID: Subject: Re: [PATCH] Handle loop fields in IPA ICF (PR ipa/90555). To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: Jakub Jelinek , Richard Biener , GCC Patches , Jan Hubicka Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg01856.txt.bz2 Hi Martin, On Tue, 28 May 2019 at 13:30, Martin Li=C5=A1ka wrote: > > On 5/27/19 2:50 PM, Jakub Jelinek wrote: > > On Mon, May 27, 2019 at 02:18:37PM +0200, Martin Li=C5=A1ka wrote: > >> +/* Compare loop information for basic blocks BB1 and BB2. */ > >> + > >> +bool > >> +func_checker::compare_loops (basic_block bb1, basic_block bb2) > >> +{ > >> + if ((bb1->loop_father =3D=3D NULL) !=3D (bb2->loop_father =3D=3D NU= LL)) > >> + return return_false (); > >> + > >> + struct loop *l1 =3D bb1->loop_father; > >> + struct loop *l2 =3D bb2->loop_father; > > > > Perhaps also > > if ((bb1 =3D=3D l1->header) !=3D (bb2 =3D=3D l2->header)) > > return return_false_with_msg ("header"); > > if ((bb1 =3D=3D l1->latch) !=3D (bb2 =3D=3D l2->latch)) > > return return_false_with_msg ("latch"); > > too? > > Yes, makes sense. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > The new testcase contains: /* { dg-do compile } */ /* { dg-options "-fopenmp-simd -O2 -mavx512f -fdump-ipa-icf" } */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ I suspect line 3 should actually be line 1, because the test fails to compile on non-x86 targets: xgcc: error: unrecognized command line option '-mavx512f' Was it your intention? Thanks, Christophe > > > > BTW, unrelated to this patch, what does ICF do if e.g. SSA_NAME_PTR_INFO > > or SSA_NAME_RANGE_INFO is different between otherwise identical functio= ns? > > Say one having early > > if (arg > 10) > > __builtin_unreachable (); > > and another one > > if (arg > - 10) > > __builtin_unreachable (); > > both optimized away into SSA_NAME_RANGE_INFO of the argument before IPA= (or > > do we optimize that away only after IPA?). > > > > Jakub > > > > Can you please provide a self-contained test-case? > > Thanks, > Martin