From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8982 invoked by alias); 13 Oct 2014 16:09:16 -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 8970 invoked by uid 89); 13 Oct 2014 16:09:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f181.google.com Received: from mail-vc0-f181.google.com (HELO mail-vc0-f181.google.com) (209.85.220.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 13 Oct 2014 16:09:15 +0000 Received: by mail-vc0-f181.google.com with SMTP id le20so5994302vcb.26 for ; Mon, 13 Oct 2014 09:09:13 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.220.197.66 with SMTP id ej2mr2399986vcb.40.1413216552909; Mon, 13 Oct 2014 09:09:12 -0700 (PDT) Received: by 10.31.179.17 with HTTP; Mon, 13 Oct 2014 09:09:12 -0700 (PDT) In-Reply-To: References: Date: Mon, 13 Oct 2014 16:09:00 -0000 Message-ID: Subject: Re: [PATCH] Add zero-overhead looping for xtensa backend From: "augustine.sterling@gmail.com" To: Felix Yang Cc: "Yangfei (Felix)" , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2014-10/txt/msg01150.txt.bz2 On Fri, Oct 10, 2014 at 6:59 AM, Felix Yang wrote: > Hi Sterling, > > I made some improvement to the patch. Two changes: > 1. TARGET_LOOPS is now used as a condition of the doloop related > patterns, which is more elegant. Fine. > 2. As the trip count register of the zero-cost loop maybe > potentially spilled, we need to change the patterns in order to handle > this issue. Actually, for xtensa you don't. The trip count is copied into LCOUNT at the execution of the loop instruction, and therefore a spill or whatever doesn't matter--it won't affect the result. So as long as you have the trip count at the start of the loop, you are fine. This does bring up an issue of whether or not the trip count can be modified during the loop. (note that this is different than early exit.) If it can, you can't use a zero-overhead loop. Does your patch address this case. The solution is similar to that adapted by c6x backend. > Just turn the zero-cost loop into a regular loop when that happens > when reload is completed. > Attached please find version 4 of the patch. Make check regression > tested with xtensa-elf-gcc/simulator. > OK for trunk?