[PATCH] Add prototype for ssa_fast_dce, add dump output for ssa-ccp

law@redhat.com law@redhat.com
Mon Jul 16 09:22:00 GMT 2001


  In message < 8766d1pw5l.fsf@cgsoftware.com >you write:
  > ssa-ccp was missing a prototype for ssa_fast_dce.
  > And it never said what it was doing when it removed edges/set
  > registers constant, in the dump file.
  > 
  > (It's also missing a prototype in ssa.h, but i'll send that in a sec).
  > 
  > 2001-07-09  Daniel Berlin  <dan@cgsoftware.com>
  > 
  > 	* ssa-ccp.c: Add prototype for ssa_fast_dce.
  > 	(optimize_unexecutable_edges): Add note about removal
  > 	of edge, and removal of phi alternative,  to dump file. 
  > 	(ssa_ccp_substitute_constants): Add note about register now being
  > 	constant, and which uses were replaced in what insns, to dump file.
You really need to be bootstrapping and testing your changes like we
require everyone to do.  I'm not going to make a habit of bootstrapping
changes from contributors who should know better.

You also need to pay more attention to our coding standards.  Similarly,
I won't make a habit of fixing coding standards issues for regular
contributors.

  > --- 756,770 ----
  >   	      while (PHI_NODE_P (insn))
  >   		{
  >   		  remove_phi_alternative (PATTERN (insn), edge->src);
  > + 		  if (rtl_dump_file)
  > + 		    fprintf (rtl_dump_file, "Removing alternative for bb %d of 
  > phi %d\n", 
Bad line wrap here.

  > + 			     edge->src->index, SSA_NAME (PATTERN (insn)));
  >   		  insn = NEXT_INSN (insn);
  >   		}
  >   	    }
  > ! 	  if (rtl_dump_file)
  > ! 	    fprintf (rtl_dump_file, "Removing edge from %d to %d because it is 
  > not executable\n",
And here.


  > *************** ssa_ccp_substitute_constants ()
  > *** 859,864 ****
  > --- 864,872 ----
  >   	     are consecutive at the start of the basic block.  */
  >   	  if (! PHI_NODE_P (def))
  >   	    {
  > + 	      if (rtl_dump_file)
  > + 		fprintf (rtl_dump_file, "Register %d is now set to a constant\n
  > ", SSA_NAME (PATTERN (def)));
And here.


  > *************** ssa_ccp_substitute_constants ()
  > *** 882,894 ****
  >   		  && (GET_CODE (useinsn) == INSN
  >   		      || GET_CODE (useinsn) == JUMP_INSN))
  >   		{
  > ! 		  validate_replace_src (regno_reg_rtx [i],
  >   					values[i].const_value,
  > ! 					useinsn);
  >   		  INSN_CODE (useinsn) = -1;
  >   		  df_insn_modify (df_analyzer,
  >   				  BLOCK_FOR_INSN (useinsn),
  >   				  useinsn);
  >   		}
  >   
  >   	    }
  > --- 890,910 ----
  >   		  && (GET_CODE (useinsn) == INSN
  >   		      || GET_CODE (useinsn) == JUMP_INSN))
  >   		{
  > ! 		  
  > ! 		  if (validate_replace_src (regno_reg_rtx [i],
  >   					    values[i].const_value,
  > ! 					    useinsn))
  > ! 		    {
  > ! 		      if (rtl_dump_file)
  > ! 			fprintf(rtl_dump_file, 
  > ! 				"Use of register %d in insn %d replace with con
  > stant value\n",
  > ! 				i, INSN_UID (useinsn));
  >   		      INSN_CODE (useinsn) = -1;
  >   		      df_insn_modify (df_analyzer,
  >   				      BLOCK_FOR_INSN (useinsn),
  >   				      useinsn);
  > + 		    }
Line wrapping problems, you forgot to reindent code after inserting a new
level of braces, you're missing whitespace between the fprintf and the
paren to start its parameter list.


I've fixed things this time, but don't expect me to do so on a regular
basis.

Bootstrapped x86-linux and installed, except for the change which
added a prototype for ssa_fast_dce which was fixed by someone else.

jeff




More information about the Gcc-patches mailing list