This is the mail archive of the 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] Speed up operand_equal_p during SSA optimizations.

Hi Kazu,

I worry that I'm make this process even more painfull than it needs
to be, but have you considered going with a variant of your original
patch that fast-paths the common cases used in the SSA optimizers in
a new operand_equal_for_phi_arg_p.

operand_equal_for_phi_arg_p (tree arg0, tree arg1)
  if (arg0 == arg1)
    return 1;
  if (TREE_CODE (arg0) == SSA_NAME || TREE_CODE (arg1) == SSA_NAME)
    return 0;
  return operand_equal_p (arg0, arg1, 0);

This has the benefit of taking advantage of the common cases in the
tree-ssa optimizers, but without adding anything to slow down
operand_equal_p, or having to check for OEP_ONLY_CONST, yet still
avoids any significant code duplication?

Of course, anything you can do to streamline operand_equal_p would
be very welcome, but looking at it's prologue it appears there's
just a lot of type-based, error-mark node, and strip NOPs handling
that just isn't relevant to comparing phi args.

Diego?  Jeff?  What do you guys think?


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