From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7987 invoked by alias); 14 Jun 2011 11:38:49 -0000 Received: (qmail 7967 invoked by uid 22791); 14 Jun 2011 11:38:48 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,TW_TM X-Spam-Check-By: sourceware.org Received: from mail-px0-f176.google.com (HELO mail-px0-f176.google.com) (209.85.212.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Jun 2011 11:38:32 +0000 Received: by pxi11 with SMTP id 11so2957352pxi.21 for ; Tue, 14 Jun 2011 04:38:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.97.34 with SMTP id z34mr524806wfl.150.1308051511711; Tue, 14 Jun 2011 04:38:31 -0700 (PDT) Received: by 10.143.93.4 with HTTP; Tue, 14 Jun 2011 04:38:31 -0700 (PDT) In-Reply-To: References: Date: Tue, 14 Jun 2011 12:17:00 -0000 Message-ID: Subject: Re: [patch] Don't insert pattern statements into the code (was Fix PR tree-optimization/49318) From: Ira Rosen To: Richard Guenther Cc: gcc-patches@gcc.gnu.org, Patch Tracking Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg01041.txt.bz2 On 14 June 2011 14:27, Richard Guenther wrote: >>> >>> =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_s= tmt, 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). 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 statem= ents >>>> =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 sta= tement >>>> =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. >>>> >>> >> >