From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22151 invoked by alias); 26 Oct 2010 16:36:50 -0000 Received: (qmail 21906 invoked by uid 22791); 26 Oct 2010 16:36:47 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-ey0-f175.google.com (HELO mail-ey0-f175.google.com) (209.85.215.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 26 Oct 2010 16:36:42 +0000 Received: by eya28 with SMTP id 28so2291273eya.20 for ; Tue, 26 Oct 2010 09:36:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.29.208 with SMTP id r16mr1818881ebc.58.1288111000352; Tue, 26 Oct 2010 09:36:40 -0700 (PDT) Received: by 10.220.112.65 with HTTP; Tue, 26 Oct 2010 09:36:39 -0700 (PDT) In-Reply-To: References: Date: Tue, 26 Oct 2010 18:30:00 -0000 Message-ID: Subject: Re: [PATCH][RFC] Clean up STMT_VINFO_VECTYPE From: "H.J. Lu" To: Richard Guenther Cc: Ira Rosen , gcc-patches@gcc.gnu.org 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: 2010-10/txt/msg02251.txt.bz2 On Fri, Apr 9, 2010 at 3:35 AM, Richard Guenther wrote: > On Mon, 1 Mar 2010, Ira Rosen wrote: > >> Richard Guenther wrote on 25/02/2010 07:05:10 PM: >> >> > This cleans up the semantic of STMT_VINFO_VECTYPE to be always the >> > vector type of the LHS of the statement. =A0This allows to get rid >> > of a lot of vector type constructions in the various vectorization >> > routines. =A0Which makes it way easier for me to add support for >> > multiple vector sizes to the vectorizer as I can restrict setting >> > vector types to a central analysis place. >> > >> > The biggest part of the patch is re-ordering of tests in the >> > analysis/transform functions where we have to call >> > vect_is_simple_use_1 to get the input vector type(s). =A0This new >> > function can now simply look up the definition statement and >> > return its STMT_VINFO_VECTYPE, something previously not possible >> > (For non-loop related definitions the analysis/transform function >> > is still responsible for choosing a proper vector type - but >> > that's something most already do or should be easy to add. =A0In >> > the patch I simply fall back to the old method for now) >> > >> > Thus, this is part 1 of a series to teach the vectorizer about >> > AVX 16/32 byte mixed vector sizes. =A0It's a cleanup that looked >> > obvious anyway, too. >> > >> > Bootstrap and regtest running on x86_64-unknown-linux-gnu. >> > >> > Does this look reasonable for 4.6? =A0I'd appreciate testing >> > on powerpc in case I missed some paths not excercised by x86_64/i?86. >> >> Looks good to me. >> I tested with vectorization testsuite on powerpc. I am now running the >> whole testsuite, will let you know if anything goes wrong. > > I have now merged some of the later changes into this patch (the > introduction of get_same_sized_vectype) so I need to touch the > same place only once. > > Re-bootstrapped and tested on x86_64-unknown-linux-gnu, committed > to trunk as follows. > > Richard. > > 2010-04-09 =A0Richard Guenther =A0 > > =A0 =A0 =A0 =A0* tree-vectorizer.h (struct _stmt_vec_info): Document > =A0 =A0 =A0 =A0that vectype is the type of the LHS. > =A0 =A0 =A0 =A0(supportable_widening_operation, supportable_narrowing_ope= ration): > =A0 =A0 =A0 =A0Get both input and output vector types as arguments. > =A0 =A0 =A0 =A0(vect_is_simple_use_1): Declare. > =A0 =A0 =A0 =A0(get_same_sized_vectype): Likewise. > =A0 =A0 =A0 =A0* tree-vect-loop.c (vect_determine_vectorization_factor): > =A0 =A0 =A0 =A0Set STMT_VINFO_VECTYPE to the vector type of the def. > =A0 =A0 =A0 =A0(vectorizable_reduction): Adjust. > =A0 =A0 =A0 =A0* tree-vect-patterns.c (vect_recog_widen_mult_pattern): > =A0 =A0 =A0 =A0Adjust. =A0Specify the output vector type. > =A0 =A0 =A0 =A0(vect_pattern_recog_1): Adjust. > =A0 =A0 =A0 =A0* tree-vect-stmts.c (get_same_sized_vectype): New function. > =A0 =A0 =A0 =A0(vectorizable_call): Adjust. > =A0 =A0 =A0 =A0(vectorizable_conversion): Likewise. > =A0 =A0 =A0 =A0(vectorizable_operation): Likewise. > =A0 =A0 =A0 =A0(vectorizable_type_demotion): Likewise. > =A0 =A0 =A0 =A0(vectorizable_type_promotion): Likewise. > =A0 =A0 =A0 =A0(vect_analyze_stmt): Set STMT_VINFO_VECTYPE to the vector = type of > =A0 =A0 =A0 =A0the def. > =A0 =A0 =A0 =A0(vect_is_simple_use_1): New function. > =A0 =A0 =A0 =A0(supportable_widening_operation): Get both input and output > =A0 =A0 =A0 =A0vector types. > =A0 =A0 =A0 =A0(supportable_narrowing_operation): Likewise. > =A0 =A0 =A0 =A0* tree-vect-slp.c (vect_schedule_slp_instance): Adjust. This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D46184 H.J.