From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25491 invoked by alias); 29 May 2008 13:02:51 -0000 Received: (qmail 25211 invoked by uid 22791); 29 May 2008 13:02:44 -0000 X-Spam-Check-By: sourceware.org Received: from web62402.mail.re1.yahoo.com (HELO web62402.mail.re1.yahoo.com) (69.147.75.31) by sourceware.org (qpsmtpd/0.31) with SMTP; Thu, 29 May 2008 13:02:18 +0000 Received: (qmail 32147 invoked by uid 60001); 29 May 2008 13:02:16 -0000 X-YMail-OSG: dnRTSiQVM1lwF1QMoNa7S7CyiS2u1JyUpypTFBoogZxRnn7brC.bG.OV_qlEJM2qUfo.4CVxG5BkE3R7DMggRL.tT1zyqpztAxsupfdfhnaCPV1HYP2wRq4RnQ-- Received: from [80.255.245.177] by web62402.mail.re1.yahoo.com via HTTP; Thu, 29 May 2008 06:02:15 PDT Date: Thu, 29 May 2008 14:34:00 -0000 From: Alex Turjan Subject: Re: gcc Digest of: get.146919 To: gcc-help@gcc.gnu.org In-Reply-To: <1212066063.24613.ezmlm@gcc.gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <151977.32041.qm@web62402.mail.re1.yahoo.com> Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-05/txt/msg00284.txt.bz2 Dear Bingfeng, Some time ago I had to deal with a similar issue as you. Basically I did as follows: I built a backend function which catches the unroll pragma and replaces it with a target assembly intrinsic (which of course has to be described in an .md file). After that in the RTL unroll phase, I analyze loop by loop and connect them to the corresponding unrolling intrinsic (which as a field contains the unrolling factor, you may add here extra information which allows you to recognize the loop) from where I decide the unrolling factor. After that in the RTL unroll phase I remove all the unroll intrinsics. hope this will help, Alex --- gcc-help@gcc.gnu.org wrote: > > gcc Digest of: get.146919 > > Topics (messages 146919 through 146919): > > Implement #pragma unroll? > 146919 by: "Bingfeng Mei" > > Administrivia: > > > --- Administrative commands for the gcc list --- > > I can handle administrative requests automatically. > Please > do not send them to the list address! Instead, send > your message to the correct command address: > > To subscribe to the list, send a message to: > > > To remove your address from the list, send a message > to: > > > Send mail to the following for info and FAQ for this > list: > > > > Similar addresses exist for the digest list: > > > > To get messages 123 through 145 (a maximum of 100 > per request), mail: > > > To get an index with subject and author for messages > 123-456 , mail: > > > They are always returned as sets of 100, max 2000 > per request, > so you'll actually get 100-499. > > To receive all messages with the same subject as > message 12345, > send an empty message to: > > > The messages do not really need to be empty, but I > will ignore > their content. Only the ADDRESS you send to is > important. > > You can start a subscription for an alternate > address, > for example "john@host.domain", just add a hyphen > and your > address (with '=' instead of '@') after the command > word: > > > To stop subscription for this address, mail: > > > In both cases, I'll send a confirmation message to > that address. When > you receive it, simply reply to it to complete your > subscription. > > If despite following these instructions, you do not > get the > desired results, please contact my owner at > gcc-owner@gcc.gnu.org. Please be patient, my owner > is a > lot slower than I am ;-) > > --- Enclosed is a copy of the request I received. > > Return-Path: > Received: (qmail 24604 invoked by uid 22791); 29 May > 2008 13:01:01 -0000 > X-Spam-Status: No, hits=1.9 required=5.0 > > tests=AWL,BAYES_00,EMPTY_MESSAGE,MISSING_SUBJECT,TVD_SPACE_RATIO > X-Spam-Check-By: sourceware.org > Received: from web62409.mail.re1.yahoo.com (HELO > web62409.mail.re1.yahoo.com) (69.147.75.86) > by sourceware.org (qpsmtpd/0.31) with SMTP; Thu, > 29 May 2008 13:00:41 +0000 > Received: (qmail 58099 invoked by uid 60001); 29 May > 2008 13:00:39 -0000 > DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; > s=s1024; d=yahoo.com; > > h=X-YMail-OSG:Received:Date:From:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; > > b=KVX550rEsn1vVYXDZGzSg1iYz+9xhBBaPkpUN/a2NiLEkeCB5ZRj8sOjcksDUhuI2Z7xcsqBTjHCQAwlZLorsXuhzq+sqXfFV5YFQ7hsyzODW1q1G5/n3fQL7pmbzGB/PaH04ivSuUaq8g4S6IqZ/Mkm6AL3HsTzi/s7y1T5YlI=; > X-YMail-OSG: > is7GqMoVM1m0leSRg_9soYaQ6do.CshBuVdAo9E7MeqsxhDshCX6gWYTIKHVvtIl_NV799R7CLk- > Received: from [80.255.245.177] by > web62409.mail.re1.yahoo.com via HTTP; Thu, 29 May > 2008 06:00:39 PDT > Date: Thu, 29 May 2008 06:00:39 -0700 (PDT) > From: Alex Turjan > To: gcc-get.146919@gcc.gnu.org > MIME-Version: 1.0 > Content-Type: text/plain; charset=iso-8859-1 > Content-Transfer-Encoding: 8bit > Message-ID: > <565468.57703.qm@web62409.mail.re1.yahoo.com> > > > > > > > > ---------------------------------------------------------------------- > > Subject: Implement #pragma unroll? > Date: Thu, 29 May 2008 02:51:49 -0700 > From: "Bingfeng Mei" > To: gcc@gcc.gnu.org > > Hello, > In porting GCC to our VLIW, we would like to > implement #pragma unroll to > manually specify unrolling factor, hoping to achieve > better performance > in some cases without changing code itself. As far > as I know, #pragma > unroll is present in both HPUX aCC and INTEL icc. I > examined pragma > implementations of some other GCC targets (arm, > m32c, etc). It seems > that these pragmas are interchangeable with > __attribute__, meaning they > are attached to either a type or a declaration. But > for loop, it is > neither a type or a declaration. In fact, when I > tracked into GCC, > LOOP_EXPR related stuff is never used. Do/while/for > loops are lowered to > individual statements in parsing stage. At best, I > can find a compound > statement (statement_list) that represent a loop. > Maybe I can invent > some attribute for unrolling factor and attach it to > the compound > statement. But I am not sure whether later > optimization (before loop > unrolling) will remove or change it. I also need to > change many places > in the gcc code itself, which is not nice. Is there > any better way to do > this? Thanks in advance. > > BTW, I am working on GCC 4.3.0. Is there any future > plan for GCC to > implement #pragma unroll or provide infrastructure > to implement similar > #pragma? I can see it will be quite useful for many > targets. > > Cheers, > Bingfeng Mei > Broadcom UK > >