From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16218 invoked by alias); 14 Jun 2011 12:02:11 -0000 Received: (qmail 16201 invoked by uid 22791); 14 Jun 2011 12:02:09 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_TM X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Jun 2011 12:01:54 +0000 Received: by wwf26 with SMTP id 26so5201106wwf.8 for ; Tue, 14 Jun 2011 05:01:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.55.67 with SMTP id t3mr6213453wbg.90.1308052913351; Tue, 14 Jun 2011 05:01:53 -0700 (PDT) Received: by 10.227.28.69 with HTTP; Tue, 14 Jun 2011 05:01:53 -0700 (PDT) In-Reply-To: References: Date: Tue, 14 Jun 2011 12:50:00 -0000 Message-ID: Subject: Re: [patch] Don't insert pattern statements into the code (was Fix PR tree-optimization/49318) From: Richard Guenther To: Ira Rosen Cc: gcc-patches@gcc.gnu.org, Patch Tracking Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2011-06/txt/msg01042.txt.bz2 On Tue, Jun 14, 2011 at 1:38 PM, Ira Rosen wrote: > On 14 June 2011 14:27, Richard Guenther wrot= e: > >>>> >>>> =A0 /* Mark the stmts that are involved in the pattern. */ >>>> - =A0gsi_insert_before (&si, pattern_stmt, GSI_SAME_STMT); >>>> =A0 set_vinfo_for_stmt (pattern_stmt, >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0new_stmt_vec_info (pattern_= stmt, loop_vinfo, NULL)); >>>> + =A0gimple_set_bb (pattern_stmt, gimple_bb (stmt)); >>>> >>>> do you really need this? >>> >>> Yes, there are a lot of uses of gimple_bb (stmt). Otherwise, we'd have >>> to check there that bb exists (or that this is not a pattern stmt) and >>> use the bb of the original statement if not. >> >> I see. =A0It's not really uglier than the part where you have to special= -case >> them when walking use-operands, so ... > > I think it is uglier, because there are 42 cases to handle instead of > a single place that you mentioned. (Probably not all the 42 can be > really reached with a pattern stmt, but still it's a lot). Well, yes - I meant setting the BB isn't uglier which means setting BB is ok. Richard. > Thanks, > Ira > >> >> Still a lot better than when inserting them for real. >> >>>> Otherwise it looks reasonable. =A0Btw, >>>> we can probably remove the simple DCE done in >>>> slpeel_tree_peel_loop_to_edge (remove_dead_stmts_from_loop) >>>> with this patch. >>> >>> I'll try that. >> >> Thanks, >> Richard. >> >>> Thanks, >>> Ira >>> >>>> >>>> Thanks, >>>> Richard. >>>> >>>>> Thanks, >>>>> Ira >>>>> >>>>> ChangeLog: >>>>> >>>>> =A0 =A0 * tree-vect-loop.c (vect_determine_vectorization_factor): Don= 't >>>>> =A0 =A0 remove irrelevant pattern statements. =A0For irrelevant state= ments >>>>> =A0 =A0 check if it is the last statement of a detected pattern, use >>>>> =A0 =A0 corresponding pattern statement instead. >>>>> =A0 =A0 (destroy_loop_vec_info): No need to remove pattern statements, >>>>> =A0 =A0 only free stmt_vec_info. >>>>> =A0 =A0 (vect_transform_loop): For irrelevant statements check if it = is >>>>> =A0 =A0 the last statement of a detected pattern, use corresponding >>>>> =A0 =A0 pattern statement instead. >>>>> =A0 =A0 * tree-vect-patterns.c (vect_pattern_recog_1): Don't insert >>>>> =A0 =A0 pattern statements. =A0Set basic block for the new statement. >>>>> =A0 =A0 (vect_pattern_recog): Update documentation. >>>>> =A0 =A0 * tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Scan >>>>> =A0 =A0 operands of pattern statements. >>>>> =A0 =A0 (vectorizable_call): Fix printing. =A0In case of a pattern st= atement >>>>> =A0 =A0 use the lhs of the original statement when creating a dummy >>>>> =A0 =A0 statement to replace the original call. >>>>> =A0 =A0 (vect_analyze_stmt): For irrelevant statements check if it is >>>>> =A0 =A0 the last statement of a detected pattern, use corresponding >>>>> =A0 =A0 pattern statement instead. >>>>> =A0 =A0 * tree-vect-slp.c (vect_schedule_slp_instance): For pattern >>>>> =A0 =A0 statements use gsi of the original statement. >>>>> >>>> >>> >> >