s of pseudo REGNO to NEW_CLASS.  Print info about it
   using TITLE.  Output a new line if NL_P.  */
static void inline
lra_change_class (int regno, enum reg_class new_class,
		  const char *title, bool nl_p)
{
  lra_assert (regno >= FIRST_PSEUDO_REGISTER);
  if (lra_dump_file != NULL)
    fprintf (lra_dump_file, "%s class %s for r%d",
	     title, reg_class_names[new_class], regno);
  setup_reg_classes (regno, new_class, NO_REGS, new_class);
  if (lra_dump_file != NULL && nl_p)
    fprintf (lra_dump_file, "\n");
}

/* Update insn operands which are duplication of NOP operand.  The
   insn is represented by its LRA internal representation ID.  */
static inline void
lra_update_dup (lra_insn_recog_data_t id, int nop)
{
  int i;
  struct lra_static_insn_data *static_id = id->insn_static_data;

  for (i = 0; i < static_id->n_dups; i++)
    if (static_id->dup_num[i] == nop)
      *id->dup_loc[i] = *id->operand_loc[nop];
}

/* Process operator duplications in insn with ID.  We do it after the
   operands processing.	 Generally speaking, we could do this probably
   simultaneously with operands processing because a common practice
   is to enumerate the operators after their operands.	*/
static inline void
lra_update_operator_dups (lra_insn_recog_data_t id)
{
  int i;
  struct lra_static_insn_data *static_id = id->insn_static_data;

  for (i = 0; i < static_id->n_dups; i++)
    {
      int ndup = static_id->dup_num[i];

      if (static_id->operand[ndup].is_operator)
	*id->dup_loc[i] = *id->operand_loc[ndup];
    }
}

/* Return info about INSN.  Set up the info if it is not done yet.  */
static inline lra_insn_recog_data_t
lra_get_insn_recog_data (rtx_insn *insn)
{
  lra_insn_recog_data_t data;
  unsigned int uid = INSN_UID (insn);

  if (lra_insn_recog_data_len > (int) uid
      && (data = lra_insn_recog_data[uid]) != NULL)
    {
      /* Check that we did not change insn without updating the insn
	 info.	*/
      lra_assert (data->insn == insn
		  && (INSN_CODE (insn) < 0
		      || data->icode == INSN_CODE (insn)));
      return data;
    }
  return lra_set_insn_recog_data (insn);
}

/* Update offset from pseudos with VAL by INCR.  */
static inline void
lra_update_reg_val_offset (int val, poly_int64 incr)
{
  int i;

  for (i = FIRST_PSEUDO_REGISTER; i < max_reg_num (); i++)
    {
      if (lra_reg_info[i].val == val)
        lra_reg_info[i].offset += incr;
    }
}

/* Return true if register content is equal to VAL with OFFSET.  */
static inline bool
lra_reg_val_equal_p (int regno, int val, poly_int64 offset)
{
  if (lra_reg_info[regno].val == val
      && known_eq (lra_reg_info[regno].offset, offset))
    return true;

  return false;
}

/* Assign value of register FROM to TO.  */
static inline void
lra_assign_reg_val (int from, int to)
{
  lra_reg_info[to].val = lra_reg_info[from].val;
  lra_reg_info[to].offset = lra_reg_info[from].offset;
}

#endif /* GCC_LRA_INT_H */
