[PATCH] Matrix Flattening and Transposing optimizations

Razya Ladelsky RAZYA@il.ibm.com
Tue May 1 11:25:00 GMT 2007


Diego Novillo <dnovillo@redhat.com> wrote on 26/04/2007 05:31:23:


> >   tmp = GIMPLE_STMT_OPERAND (stmt, 1);
> >   malloc_fn_decl = CALL_EXPR_FN (tmp);
> >   if (TREE_CODE (malloc_fn_decl) != ADDR_EXPR
> >       || TREE_CODE (TREE_OPERAND (malloc_fn_decl, 0)) != FUNCTION_DECL
> >       || DECL_FUNCTION_CODE (TREE_OPERAND (malloc_fn_decl, 0)) !=
> >       BUILT_IN_MALLOC)
> 
> Better use get_call_expr_in and call_expr_flags as in is_malloc_result.
> 

I think it's not good enough. I want to trace the specific 'malloc' C 
calls 
and not any other call which has the malloc attribute assigned.


> 
> >          malloc_fn_decl = CALL_EXPR_FN (rhs);
> >          if (TREE_CODE (malloc_fn_decl) != ADDR_EXPR
> >         || TREE_CODE (TREE_OPERAND (malloc_fn_decl, 0)) !=
> >         FUNCTION_DECL)
> >       {
> >         mark_min_matrix_escape_level (mi, level, stmt);
> >         return;
> >       }
> >          malloc_fn_decl = TREE_OPERAND (malloc_fn_decl, 0);
> >          malloc_fname = IDENTIFIER_POINTER (DECL_NAME 
(malloc_fn_decl));
> >          if (DECL_FUNCTION_CODE (malloc_fn_decl) != BUILT_IN_MALLOC)
> 
> Better use call_expr_flags().  Or do you specifically need 'malloc'?
> 

Same here.




More information about the Gcc-patches mailing list