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 977BD388460F for ; Thu, 1 Jul 2021 14:49:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 977BD388460F 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 6E179228CB; Thu, 1 Jul 2021 14:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1625150961; 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=nNvyfCh4eivuTYc5nV6fI3NtJER+mn1xcJHFUYOCrqk=; b=s3wfMDynVw0i8pXgKbXJgomYs1oMEnhqkZUSqPp/YIKaTeBAdJMpuUJVEcAEBs52tRZ3YO qI7r/AeHhV5mWyMMnQJxr055F0Hmknvce5GC9yNq/PhyQqCeP23vjaluYn++0x0wYB02IG 1+MBWRUOXHtKjkwW+HCC6xiERDilDLE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1625150961; 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=nNvyfCh4eivuTYc5nV6fI3NtJER+mn1xcJHFUYOCrqk=; b=qYIIOPsb6RL4MqSBljGFipvwUBg7oO5HyElWS8NjO32AA7NaPou8jjOkedTgC6BNl2U+pD L11QK2QmHOHKbiBA== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (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 5F2D1A3B95; Thu, 1 Jul 2021 14:49:21 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id 55DA8672C; Thu, 1 Jul 2021 14:49:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id 54789671F; Thu, 1 Jul 2021 14:49:21 +0000 (UTC) Date: Thu, 1 Jul 2021 14:49:21 +0000 (UTC) From: Michael Matz To: Richard Biener 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.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-8.8 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: Thu, 01 Jul 2021 14:49:23 -0000 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) Ciao, Michael.