From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id E9BD63857807 for ; Fri, 2 Jul 2021 06:03:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E9BD63857807 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id DF33122892; Fri, 2 Jul 2021 06:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1625205810; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=78s6q4l3l6piSkOzM1eDuoJa6txiz1/pN10fDOvXZiM=; b=sN236vVk1qYXT8E6JQIGCXRIiH37T69AjkzIJsBY+Cvsm5POTN3ENaOwovNvy2zK32m0VM eAtS0zEfy5R3CPqVbYWuZPBOm15DF/+1INIBD7VNOh2zCEsn6V3U2Z24hKwVp1rkFhJ321 bnEG+MHVxXJkL3K9ZorWiIr0rcx/LlQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1625205810; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=78s6q4l3l6piSkOzM1eDuoJa6txiz1/pN10fDOvXZiM=; b=xLMoLEN5yfPiRphYVwA930Ju6P/HsPt7nHSk5TPdKs1R1qOBbkwjyGEohpdLFVcwxSZzNi qNNysRP4SWdh9/BA== Received: from murzim.suse.de (murzim.suse.de [10.160.4.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id B2CFAA3B84; Fri, 2 Jul 2021 06:03:30 +0000 (UTC) Date: Fri, 2 Jul 2021 08:03:30 +0200 (CEST) From: Richard Biener To: Michael Matz cc: gcc-patches@gcc.gnu.org, bin.cheng@linux.alibaba.com Subject: Re: [PATCH] tree-optimization/101280 - revise interchange fix for PR101173 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jul 2021 06:03:33 -0000 On Thu, 1 Jul 2021, Michael Matz wrote: > Hello, > > On Thu, 1 Jul 2021, Richard Biener wrote: > > > diff --git a/gcc/gimple-loop-interchange.cc b/gcc/gimple-loop-interchange.cc > > index 43045c5455e..43ef112a2d0 100644 > > --- a/gcc/gimple-loop-interchange.cc > > +++ b/gcc/gimple-loop-interchange.cc > > @@ -1043,8 +1043,11 @@ tree_loop_interchange::valid_data_dependences (unsigned i_idx, unsigned o_idx, > > continue; > > > > /* Be conservative, skip case if either direction at i_idx/o_idx > > - levels is not '=' (for the inner loop) or '<'. */ > > - if (dist_vect[i_idx] < 0 || dist_vect[o_idx] <= 0) > > + levels is not '=' or '<'. */ > > + if (dist_vect[i_idx] < 0 > > + || (DDR_REVERSED_P (ddr) && dist_vect[i_idx] > 0) > > + || dist_vect[o_idx] < 0 > > + || (DDR_REVERSED_P (ddr) && dist_vect[o_idx] > 0)) > > Hmm, if DDR_REVERSED_P matters here, then it should matter for all arms. > IOW: < 0 should be tested only when !DDR_REVERSED_P, not always: > > if ((!DDR_REVERSED_P (ddr) && dist_vect[i_idx] < 0) > || (DDR_REVERSED_P (ddr) && dist_vect[i_idx] > 0) > || (!DDR_REVERSED_P (ddr) && dist_vect[o_idx] < 0) > || (DDR_REVERSED_P (ddr) && dist_vect[o_idx] > 0)) > > (what you have effectively written is a condition that allows only 0 when > DDR_REVERSED_P) True - been fixing bugs too fast I guess. Maybe the 3rd time's the charm then ;) Richard.