record_base_value (REGNO (tem), bl->biv->add_val);
final_giv_value (v, loop_start, loop_end)     struct induction *v;     rtx loop_start, loop_end;{  struct iv_class *bl;  rtx insn;  rtx increment, tem;  rtx insert_before, seq;  bl = reg_biv_class[REGNO (v->src_reg)];  /* The final value for givs which depend on reversed bivs must be calculated     differently than for ordinary givs.  In this case, there is already an     insn after the loop which sets this giv's final value (if necessary),     and there are no other loop exits, so we can return any value.  */  if (bl->reversed)    {      if (loop_dump_stream)	fprintf (loop_dump_stream,		 "Final giv value for %d, depends on reversed biv\n",		 REGNO (v->dest_reg));      return const0_rtx;    }  /* Try to calculate the final value as a function of the biv it depends     upon.  The only exit from the loop must be the fall through at the bottom     (otherwise it may not have its final value when the loop exits).  */        /* ??? Can calculate the final giv value by subtracting off the     extra biv increments times the giv's mult_val.  The loop must have     only one exit for this to work, but the loop iterations does not need     to be known.  */  if (loop_n_iterations != 0      && ! loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]])    {      /* ?? It is tempting to use the biv's value here since these insns will	 be put after the loop, and hence the biv will have its final value	 then.  However, this fails if the biv is subsequently eliminated.	 Perhaps determine whether biv's are eliminable before trying to	 determine whether giv's are replaceable so that we can use the	 biv value here if it is not eliminable.  */      increment = biv_total_increment (bl, loop_start, loop_end);      if (increment && invariant_p (increment))	{	  /* Can calculate the loop exit value of its biv as	     (loop_n_iterations * increment) + initial_value */	      	  /* The loop exit value of the giv is then	     (final_biv_value - extra increments) * mult_val + add_val.	     The extra increments are any increments to the biv which	     occur in the loop after the giv's value is calculated.	     We must search from the insn that sets the giv to the end	     of the loop to calculate this value.  */	  insert_before = NEXT_INSN (loop_end);	  /* Put the final biv value in tem.  */	  tem = gen_reg_rtx (bl->biv->mode);	  emit_iv_add_mult (increment, GEN_INT (loop_n_iterations),			    bl->initial_value, tem, insert_before);	  /* Subtract off extra increments as we find them.  */	  for (insn = NEXT_INSN (v->insn); insn != loop_end;	       insn = NEXT_INSN (insn))	    {	      struct induction *biv;	      for (biv = bl->biv; biv; biv = biv->next_iv)		if (biv->insn == insn)		  {		    start_sequence ();		    tem = expand_binop (GET_MODE (tem), sub_optab, tem,					biv->add_val, NULL_RTX, 0,					OPTAB_LIB_WIDEN);		    seq = gen_sequence ();		    end_sequence ();		    emit_insn_before (seq, insert_before);		  }	    }	  	  /* Now calculate the giv's final value.  */	  emit_iv_add_mult (tem, v->mult_val, v->add_val, tem,			    insert_before);	  	  if (loop_dump_stream)	    fprintf (loop_dump_stream,		     "Final giv value for %d, calc from biv's value.\n",		     REGNO (v->dest_reg));	  return tem;	}    }  /* Replaceable giv's should never reach here.  */  if (v->replaceable)    abort ();  /* Check to see if the biv is dead at all loop exits.  */  if (reg_dead_after_loop (v->dest_reg, loop_start, loop_end))    {      if (loop_dump_stream)	fprintf (loop_dump_stream,		 "Final giv value for %d, giv dead after loop exit.\n",		 REGNO (v->dest_reg));      return const0_rtx;    }  return 0;}