From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by sourceware.org (Postfix) with ESMTPS id 304893831E58 for ; Wed, 14 Dec 2022 11:06:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 304893831E58 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-lf1-x134.google.com with SMTP id bp15so9775764lfb.13 for ; Wed, 14 Dec 2022 03:06:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PZ1HZwh+lxo/ku8pyBlqlysZJc63Bwyho7qh7Gm133g=; b=iyTG4k7Y6gThNno3cWAFhYqV1dkOTlaQkkslBGkDFT8Gpm5QeYb0lTNhn9YAPI6SAH wAVXjI86BXx2XcSFYUlBYyLJFByKL95k8OPbORUkFDc+I6Bj0CcU9q8Yv52KSlnOoDGu wSUmwK89IDmV9RgLls95gh75GUsKGO5I8leK7g7Z44R15ATT+B8Yioxn/JhgecmHSNav xOaSUyQmJwLswbuImGeBgBvLaE/eH474awujIIANwEenahZ+HxFRfbEbeGfy7HIhxMzH L09oWI27RhS9DacobXrpxbYlEFV6/TK4x5cKdYcOmdgDI5bVAo2cBwNjwPdC8sABR1zJ iByA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PZ1HZwh+lxo/ku8pyBlqlysZJc63Bwyho7qh7Gm133g=; b=yt6h7XofGgCOEZ3emwWYEc/gnd2BiDEeZ+Xu2GRFqqX43FXwxRvURrU0qyysVe4rmB eD58rVtQ8x1G04Ud5JcXI/CAMh49A65U86TDdTO4bZbkiuOdeLWVVY8v/rhlJ3kaGmya eDrmVFGvOtCH50PWUl4uVhR4ydFygdDkQzB2NE9czYij0scYusxQ6uCWHSVOr695IjgU mGBiMs1k4ZevVJ5i/76pOHLaIJracKDiw2l+f6QJr7tyy8Z5T/qTe7oE3upMsQVGW2dH s3i9R6b1gkk//g4kVN5WVmsX0BFNdojSvzQMJWcs93LC7WYuXB/OlXKvEJOGnJZ6daiX ZpKw== X-Gm-Message-State: ANoB5pn6H+ifyNZsYtuKoylcjfRas9CGRV3erbSgNJ5tVs++cOIi7mml +YMFAUymnTrJN1WmTK8lxzeF3D8nYPsXnYt1l3A= X-Google-Smtp-Source: AA0mqf4vZOfuNttEYyGhoLCiDnYnJtCl1NUr/ryMafjh3SyCTzq9KzusRVeFM/vUtjHAtKRMSlboLO2fi8mu9XNNRgI= X-Received: by 2002:a05:6512:376c:b0:4ad:70c1:de61 with SMTP id z12-20020a056512376c00b004ad70c1de61mr31415547lft.509.1671015992441; Wed, 14 Dec 2022 03:06:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Wed, 14 Dec 2022 12:06:20 +0100 Message-ID: Subject: Re: Possible regression in DF analysis To: Claudiu Zissulescu Ianculescu Cc: Eric Botcazou , gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,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 Wed, Dec 14, 2022 at 11:37 AM Claudiu Zissulescu Ianculescu wrote: > > I have update the fix to this one: > > diff --git a/gcc/df-core.cc b/gcc/df-core.cc > index a901b84878f..cc6383990a1 100644 > --- a/gcc/df-core.cc > +++ b/gcc/df-core.cc > @@ -1437,7 +1437,16 @@ df_analyze_loop (class loop *loop) > df_set_blocks (blocks); > BITMAP_FREE (blocks); > > - df_analyze_1 (); > + /* Iterate over loop's exit edges and add theirs destinations BB > + indexes. */ > + struct loop_exit *exit; > + for (exit = loop->exits->next; exit->e; exit = exit->next) > + bitmap_set_bit (df->blocks_to_analyze, exit->e->dest->index); I think you want to adjust the local 'blocks' bitmap passed to df_set_blocks. There's also the issue that the computed postorder doesn't include the new blocks and thus the computation will likely be invalid? > + > + if (dump_file) > + debug_bitmap_file (dump_file, df->blocks_to_analyze); > + > + df_analyze (); > } > > I still need to validate it for x86 > > Best, > Claudiu > > On Tue, Dec 13, 2022 at 7:38 PM Claudiu Zissulescu Ianculescu > wrote: > > > > > > > > Maybe you want to iterate over the loops exit edges and include their destination block instead? > > > > > > > This is better approach, let me try it and I will be back to you. > > > > Thanks, > > Claudiu