From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19949 invoked by alias); 14 Aug 2007 11:38:21 -0000 Received: (qmail 19783 invoked by uid 22791); 14 Aug 2007 11:37:43 -0000 X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 14 Aug 2007 11:37:35 +0000 Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IKulh-00044x-ET for gcc-patches@gnu.org; Tue, 14 Aug 2007 07:41:02 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1IKuiH-0002He-T9 for gcc-patches@gnu.org; Tue, 14 Aug 2007 07:37:31 -0400 Received: from nikam-dmz.ms.mff.cuni.cz ([195.113.20.16] helo=nikam.ms.mff.cuni.cz) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IKuiH-0002HO-E1 for gcc-patches@gnu.org; Tue, 14 Aug 2007 07:37:29 -0400 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 29025) id 830195BA6F; Tue, 14 Aug 2007 13:37:27 +0200 (CEST) Date: Tue, 14 Aug 2007 11:38:00 -0000 From: Zdenek Dvorak To: Victor Kaplansky Cc: gcc-patches@gnu.org Subject: Re: [PATCH] [4.3 projects] Verctorizer - versioning for alias Message-ID: <20070814113727.GB30867@kam.mff.cuni.cz> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Detected-Kernel: Linux 2.6 (newer, 1) 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: 2007-08/txt/msg00849.txt.bz2 Hello, > * gcc.dg/vect/vect-vfa-01.c: New. > * gcc.dg/vect/vect-vfa-02.c: New. > * gcc.dg/vect/vect-vfa-03.c: New. > (See attached file: vfa.txt) > Index: testsuite/gcc.dg/vect/vect-vfa-01.c > =================================================================== > --- testsuite/gcc.dg/vect/vect-vfa-01.c (revision 0) > +++ testsuite/gcc.dg/vect/vect-vfa-01.c (revision 0) > @@ -0,0 +1,39 @@ > +/* { dg-require-effective-target vect_int } */ > + > +#include > +#include "tree-vect.h" > + > +#define N 16 > +int result[N] = {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27}; > +int X[N] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}; > +int Y[N] = {}; > + > +void > +foo (int *in, int *out) > +{ > + int i; > + > + for (i = 0; i < N; i++) > + out[i] = in[i] + 2; > +} > + > +int > +main (void) > +{ > + int i; > + > + check_vect (); > + > + foo (X, Y); could you also add some test that checks the situation where the IN and OUT pointers overlap in such a way that the vectorized copy of the loop would produce wrong results (if it were used)? > +/* Return TRUE if DDR_NEW is already found in MAY_ALIAS_DDRS list. */ > +static bool > +vect_is_duplicate_ddr (VEC (ddr_p, heap) * may_alias_ddrs, ddr_p ddr_new) There should be an empty line between the comment and the function. > +/* Function vect_create_cond_for_alias_checks. > > + Create a conditional expression that represents the run-time checks for > + overlapping of adress ranges represented by a list of data references > + relations passed as input. > + > + Input: > + COND_EXPR - input conditional expression. New conditions will be chained > + logical and operation. ^ with > + LOOP_VINFO - fields of the loop information are used. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I am not sure what this sentence is supposed to mean. > + part_cond_expr = > + fold_build2 (TRUTH_OR_EXPR, boolean_type_node, > + fold_build2 (LT_EXPR, boolean_type_node, > + fold_build2 (PLUS_EXPR, ptr_type_node, ^^^^^^^^^ should be POINTER_PLUS_EXPR. It is a bit suspicious that this passes testing, as it should ICE in build2. Can you check why it does not? > + addr_base_a, > + segment_length_a), > + addr_base_b), > + fold_build2 (LT_EXPR, boolean_type_node, > + fold_build2 (PLUS_EXPR, ptr_type_node, Ditto. > Index: params.def > =================================================================== > --- params.def (revision 127316) > +++ params.def (working copy) > @@ -485,11 +485,16 @@ > "When set to 1, use expensive methods to eliminate all redundant constraints", > 0, 0, 1) > > -DEFPARAM(PARAM_VECT_MAX_VERSION_CHECKS, > - "vect-max-version-checks", > - "Bound on number of runtime checks inserted by the vectorizer's loop versioning", > +DEFPARAM(PARAM_VECT_MAX_VERSION_FOR_ALIGNMENT_CHECKS, > + "vect-max-version-for-alignment-checks", > + "Bound on number of runtime checks inserted by the vectorizer's loop versioning for alignment check", > 6, 0, 0) > > +DEFPARAM(PARAM_VECT_MAX_VERSION_FOR_ALIAS_CHECKS, > + "vect-max-version-for-alias-checks", > + "Bound on number of runtime checks inserted by the vectorizer's loop versioning for alias check", > + 10, 0, 0) > + The params should be documented in invoke.texi. Otherwise, the patch is OK. Zdenek