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] Update if-conversion for AV



On Sep 21, 2004, at 2:53 PM, Richard Henderson wrote:


On Thu, Sep 16, 2004 at 09:50:27AM -0700, Devang Patel wrote:
    if (else_clause)
      {
+       tree c2;
+       if (!is_gimple_reg(c) && is_gimple_condexpr (c))
+ 	{
+ 	  tree new_stmt;
+ 	  new_stmt = ifc_temp_var (TREE_TYPE (c), unshare_expr (c));
+ 	  bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT);
+ 	  c = TREE_OPERAND (new_stmt, 0);
+ 	}
+
        /* if 'c' is false then else_clause is reached.  */
!       c2 = build1 (TRUTH_NOT_EXPR,
! 		   boolean_type_node,
! 		   unshare_expr (c));

You want invert_truth_value instaed.

OK


+ /* Now if possible, merge loop header and block with exit edge.
+ This reduces number of basic blocks to 2. Auto vectorizer addresses
+ loops with two nodes only. */
+ if (exit_bb != loop->latch && empty_block_p (loop->latch))
+ {
+ if (can_merge_blocks_p (loop->header, exit_bb))
+ {
+ merge_blocks (loop->header, exit_bb);
+ loop->num_nodes--;
+ }

Why not just run a cleanup_cfg pass?

Thinking like ... Instead of one entire pass why not just merge two blocks that we know?

I can run a cleanup_cfg() pass in main_tree_if_conversion() so that it
is not used for each loop.

-
Devang


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