This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] tree level if-conversion for vectorizer


On Fri, Aug 27, 2004 at 06:41:53PM -0700, Devang Patel wrote:
> *************** expand_expr_real_1 (tree exp, rtx target
> *** 7851,7859 ****
>     	 for side effect only.  If type is void, we must do likewise.  */
>   
>           if (TREE_ADDRESSABLE (type)
> !  	  || ignore
> !  	  || TREE_TYPE (TREE_OPERAND (exp, 1)) == void_type_node
> !  	  || TREE_TYPE (TREE_OPERAND (exp, 2)) == void_type_node)
>    	abort ();
>   
>          /* If we are not to produce a result, we have no target.  Otherwise,
> --- 7851,7857 ----
>     	 for side effect only.  If type is void, we must do likewise.  */
>   
>           if (TREE_ADDRESSABLE (type)
> ! 	    || ignore)
>    	abort ();

If you need this, then you havn't addressed my concerns wrt

	T = cond ? (void)B : A

> *************** is_gimple_stmt (tree t)
> *** 363,369 ****
>     switch (code)
>       {
>       case BIND_EXPR:
> -     case COND_EXPR:
>         /* These are only valid if they're void.  */
>         return TREE_TYPE (t) == NULL || VOID_TYPE_P (TREE_TYPE (t));
>   
> --- 363,368 ----
> *************** is_gimple_stmt (tree t)
> *** 380,385 ****
> --- 379,385 ----
>       case RESX_EXPR:
>       case PHI_NODE:
>       case STATEMENT_LIST:
> +     case COND_EXPR:
>         /* These are always void.  */

Still in the wrong place.

> +   /* Create temporary for C in < A = COND_EXPR < C, B>>.  
> +      Vectorizier prefers to have gimple condexpr as part of COND_EXPR
> +      cond.  */
> +   if (is_gimple_condexpr (cond))
> +     new_cond = unshare_expr (cond);
> +   else
> +     new_cond = ifc_temp_var (boolean_type_node, unshare_expr (cond), bsi, true);

You should be creating one instane of C for the entire basic block.
Not one per statement.  And your comment wrt the vectorizer is 
inaccurate: the vectorizer prefers to have a gimple *value*.  And 
you should say why, not just that it does.



r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]