From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60566 invoked by alias); 23 Jul 2015 14:45:17 -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 59677 invoked by uid 89); 23 Jul 2015 14:45:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f176.google.com Received: from mail-ob0-f176.google.com (HELO mail-ob0-f176.google.com) (209.85.214.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 23 Jul 2015 14:45:15 +0000 Received: by obre1 with SMTP id e1so155452299obr.1 for ; Thu, 23 Jul 2015 07:45:13 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.20.141 with SMTP id n13mr9160869obe.26.1437662713257; Thu, 23 Jul 2015 07:45:13 -0700 (PDT) Received: by 10.202.106.145 with HTTP; Thu, 23 Jul 2015 07:45:13 -0700 (PDT) In-Reply-To: References: Date: Thu, 23 Jul 2015 15:21:00 -0000 Message-ID: Subject: Re: [PATCH] Unswitching outer loops. From: Yuri Rumyantsev To: Richard Biener Cc: gcc-patches , Igor Zamyatin Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-07/txt/msg01950.txt.bz2 Hi Richard, I checked that both test-cases from 23855 are sucessfully unswitched by proposed patch. I understand that it does not catch deeper loop nest as for (i=0; i<10; i++) for (j=0;j: > On Fri, Jul 10, 2015 at 12:02 PM, Yuri Rumyantsev wrote: >> Hi All, >> >> Here is presented simple transformation which tries to hoist out of >> outer-loop a check on zero trip count for inner-loop. This is very >> restricted transformation since it accepts outer-loops with very >> simple cfg, as for example: >> acc = 0; >> for (i = 1; i <= m; i++) { >> for (j = 0; j < n; j++) >> if (l[j] == i) { v[j] = acc; acc++; }; >> acc <<= 1; >> } >> >> Note that degenerative outer loop (without inner loop) will be >> completely deleted as dead code. >> The main goal of this transformation was to convert outer-loop to form >> accepted by outer-loop vectorization (such test-case is also included >> to patch). >> >> Bootstrap and regression testing did not show any new failures. >> >> Is it OK for trunk? > > I think this is > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23855 > > as well. It has a patch adding a invariant loop guard hoisting > phase to loop-header copying. Yeah, it needs updating to > trunk again I suppose. It's always non-stage1 when I come > back to that patch. > > Your patch seems to be very specific and only handles outer > loops of innermost loops. > > Richard. > >> ChangeLog: >> 2015-07-10 Yuri Rumyantsev >> >> * tree-ssa-loop-unswitch.c: Include "tree-cfgcleanup.h" and >> "gimple-iterator.h", add prototype for tree_unswitch_outer_loop. >> (tree_ssa_unswitch_loops): Add invoke of tree_unswitch_outer_loop. >> (tree_unswitch_outer_loop): New function. >> >> gcc/testsuite/ChangeLog: >> * gcc.dg/tree-ssa/unswitch-outer-loop-1.c: New test. >> * gcc.dg/vect/vect-outer-simd-3.c: New test.