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] Matrix Flattening and Transposing optimizations


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.



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