From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by sourceware.org (Postfix) with ESMTPS id 1FD3B382E458 for ; Wed, 14 Dec 2022 12:39:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1FD3B382E458 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-x131.google.com with SMTP id p8so10173540lfu.11 for ; Wed, 14 Dec 2022 04:39:51 -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=Q3MoKJckVsaEN0a1iNn471nVS79hbbSyDAIrC+sBqzw=; b=lNa9TyqhydsY6W35eDNSxkMJLd5GOMlFazoW+sPCLUYIDlbTX/tZUX6utpbTqNc4Z/ EmtpnngsEn6L/zwKIFnmx9kJawNtYdvxYmuS4HMNuMEuXlN4wbtc4DdPKgCre6SeaxGq abxBXWkazqIxj2j54eGtLzJHEW1cyIvG7htCniOYoVJ8R1C47A0WkWJgxjehhMdcPieK u29TcAo+nOROm7uKVgWoNlhvuoy8qFoiKEP02O4SEStQy+nGsqu605y51lHruSFewiIq rgkbYgWJrQ5ApktSjc41mlu7Qu9RSo03I0Z3ocJIeVp+Bo57qGtaEpYrqM3NBwxZN4NL US2g== 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=Q3MoKJckVsaEN0a1iNn471nVS79hbbSyDAIrC+sBqzw=; b=RcEikCPxjISK8s5j0NXY1uNDAAnwWrgU7duZPRdsDIakyswxbvQsfMRXLFapZPEoQ3 6f5Hug0OMaxwzqvXl6YM8znkOuoY9XrSJN3KEOH8vUr6jr3G7FUBEnCfmTHPvl5dxMCh lfl+lDwtFWh5iKQ5G1a4G6fGyxJBvExi8SkMYtwzyATyj7a56nYn6lG6uMBiS7M2Uul1 IKzR79ttDQ4fQrUEV5luhT72+W9AT8FW5VHR8Xkis9EXNTqYp9d9JQHwr7QJazDpk0y0 55KrYJXHzt2YsIikx4LAhKTgF7t2gI/LO6SkxcEzbjafaKg9MUV2S95vHrKgWjDRWkm7 HBCw== X-Gm-Message-State: ANoB5pkquwlO4nMY1GB8Jnhyd5VcUhb6mExBeB45z+6FKbVfnmskTDaM T5sLrwCrJAVQassHLhdWrkuJajyLLyYD/oChMKQ= X-Google-Smtp-Source: AA0mqf5LHEkAUkzQ/FoG500otU+tipzmK7kprBH+lGJpN7IiCTjYxLFocWd9rWj67wleKBl5G8EW2CVSKXvN5rvqVy8= X-Received: by 2002:ac2:4c42:0:b0:4a5:bf09:a700 with SMTP id o2-20020ac24c42000000b004a5bf09a700mr25737756lfk.656.1671021589186; Wed, 14 Dec 2022 04:39:49 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Wed, 14 Dec 2022 13:39:35 +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=-6.8 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 12:30 PM Claudiu Zissulescu Ianculescu wrote: > > Hi Richard, > > Sorry for my misunderstanding. I am calling the df_analyze() instead > of df_analyze1() at the end. Shouldn't df_analyze take care and > compute the correct postorder (df-core.cc:1273) ? The point of df_analyze_loop is to be more efficient than doing a full df_analyze (but of course that's only so in a limited way, still ...) > Thank you, > Claudiu > > On Wed, Dec 14, 2022 at 1:06 PM Richard Biener > wrote: > > > > 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