public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zdenek Dvorak <rakdver@kam.mff.cuni.cz>
To: Victor Kaplansky <VICTORK@il.ibm.com>
Cc: gcc-patches@gnu.org
Subject: Re: [PATCH] [4.3 projects] Verctorizer - versioning for alias
Date: Tue, 14 Aug 2007 11:38:00 -0000	[thread overview]
Message-ID: <20070814113727.GB30867@kam.mff.cuni.cz> (raw)
In-Reply-To: <OFFD346E44.D15F9B49-ONC2257337.00301C78-C2257337.003C743B@il.ibm.com>

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 <stdarg.h>
> +#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

  reply	other threads:[~2007-08-14 11:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-14 11:02 Victor Kaplansky
2007-08-14 11:38 ` Zdenek Dvorak [this message]
2007-08-14 12:23   ` Victor Kaplansky
2007-08-14 17:07 ` Dorit Nuzman
     [not found] <OF128D770D.7C095078-ONC2257337.00562B23-C2257337.005E3D6E@LocalDomain>
2007-08-16 11:07 ` Victor Kaplansky
2007-08-16 13:09   ` Dorit Nuzman
     [not found] <OF531586B8.1BD86F22-ONC2257339.0046568C-C2257339.00487D11@LocalDomain>
2007-08-16 13:49 ` Victor Kaplansky
     [not found] <OFD8F5F2C8.37DFE3DF-ONC2257339.004A59E3-C2257339.004BD2B1@LocalDomain>
2007-08-18  7:54 ` Dorit Nuzman
2007-08-19  9:20 ` Dorit Nuzman
2007-08-19 15:13 ` Dorit Nuzman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070814113727.GB30867@kam.mff.cuni.cz \
    --to=rakdver@kam.mff.cuni.cz \
    --cc=VICTORK@il.ibm.com \
    --cc=gcc-patches@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).