public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Tree profilng merge 1 - allow inserting onto edge to EXIT_BLOCK
@ 2004-05-28 14:00 Jan Hubicka
  2004-06-02  4:12 ` Jeffrey A Law
  2004-06-07  0:50 ` Richard Henderson
  0 siblings, 2 replies; 9+ messages in thread
From: Jan Hubicka @ 2004-05-28 14:00 UTC (permalink / raw)
  To: gcc-patches, rth

Hi,
for bootstrap with tree profiling we must be able to split edges to
EXIT_BLOCK.  This has been discussed with RTH on irc in the past

Honza

Bootstrapped/regtested i686-pc-gnu-linux without libjava, of course will
re-test with libjava if approved.  OK?

2004-05-28  Jan Hubicka  <jh@suse.cz>
	* gimple-low.c (tree_find_edge_insert_loc):  Allow inserting before
	return_stmt.
Index: gimple-low.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gimple-low.c,v
retrieving revision 2.2
retrieving revision 1.1.4.17.2.7
diff -c -3 -p -r2.2 -r1.1.4.17.2.7
*************** tree_find_edge_insert_loc (edge e, block
*** 2834,2839 ****
--- 2858,2879 ----
        tmp = bsi_stmt (*bsi);
        if (!stmt_ends_bb_p (tmp))
  	return true;
+ 
+       /* Insert code just before returning the value.  We may need to decompose
+          the return in the case it contains non-trivial operand.  */
+       if (TREE_CODE (tmp) == RETURN_EXPR)
+         {
+ 	  tree op = TREE_OPERAND (tmp, 0);
+ 	  if (!is_gimple_val (op))
+ 	    {
+ 	      if (TREE_CODE (op) != MODIFY_EXPR)
+ 		abort ();
+ 	      bsi_insert_before (bsi, op, BSI_NEW_STMT);
+ 	      TREE_OPERAND (tmp, 0) = TREE_OPERAND (op, 0);
+ 	    }
+ 	  bsi_prev (bsi);
+ 	  return true;
+         }
      }
  
    /* Otherwise, create a new basic block, and split this edge.  */

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Tree profilng merge 1 - allow inserting onto edge to EXIT_BLOCK
@ 2004-06-07  0:55 Richard Kenner
  2004-06-07  6:10 ` Richard Henderson
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Kenner @ 2004-06-07  0:55 UTC (permalink / raw)
  To: rth; +Cc: gcc-patches

    Wait on this.  Jason and I talked about redefining things such that
    we only ever have one RETURN_EXPR in a function, and that it always
    only contains just the result_decl.

Would this be visible to front ends or done during gimplification?

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-06-08 13:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-28 14:00 Tree profilng merge 1 - allow inserting onto edge to EXIT_BLOCK Jan Hubicka
2004-06-02  4:12 ` Jeffrey A Law
2004-06-07  0:50 ` Richard Henderson
2004-06-07 14:32   ` Jeffrey A Law
2004-06-07 15:39     ` Paolo Bonzini
2004-06-07 18:40       ` Richard Henderson
2004-06-08 14:55   ` Jan Hubicka
2004-06-07  0:55 Richard Kenner
2004-06-07  6:10 ` Richard Henderson

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).