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] var-tracking.c speedups



Why not make rtx_equal_p a static inline function in rtl.h?  It could
even handle the common cases directly.

static inline int /* should be bool but that is a separate change */
rtx_equal_p (const_rtx x, const_rtx y)
{
  if (x == y)
    return 1;
  if (x == NULL_RTX || y == NULL_RTX)
    return 0;
  if (GET_CODE (x) != GET_CODE (y))
    return 0;
  return rtx_equal_p_cb (x, y, NULL);
}

Or


static inline int /* should be bool but that is a separate change */
rtx_equal_p (const_rtx x, const_rtx y)
{
  if (x == y)
    return 1;
  if (x == NULL_RTX || y == NULL_RTX)
    return 0;
  if (GET_CODE (x) != GET_CODE (y))
    return 0;
  return rtx_equal_p_cb_1 (x, y, NULL);
}

static inline int /* should be bool but that is a separate change */
rtx_equal_p_cb (const_rtx x, const_rtx y, yaddayadda)
{
  if (x == y)
    return 1;
  if (x == NULL_RTX || y == NULL_RTX)
    return 0;
  if (GET_CODE (x) != GET_CODE (y))
    return 0;
  return rtx_equal_p_cb_1 (x, y, yaddayadda);
}

so that you can remove the common checks from the callee, too.

Paolo


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