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]

[PATCH GCC]Cleanup interface of iv_ca_add_use and the calls to it


Hi,
As I analyzed in bug pr62178, current candidate selecting algorithm can't
find out the optimal solution in some scenarios.  I am trying to improve it
but before that, I need to clean up the interface of iv_ca_add_use and the
calls to it.  The two calls to the function are controlled by a boolean
argument, and the second call is always fired if the first one doesn't give
any result.  This patch encapsulates logic of the two calls into function
iv_ca_add_use and cleanups the interface.
Another change is remove the check in below code.

  gcc_assert (ivs->upto >= use->id);

  if (ivs->upto == use->id)
    {
      ivs->upto++;
      ivs->bad_uses++;
    }

It can be proved in an inductive approach that ivs->up_to always equals to
use->id at the position.

This patch does not change code logic at all, anyway, it passes bootstrap
and regtest on x86_64/x86.  So is it OK?

Thanks,
bin

2014-08-27  Bin Cheng  <bin.cheng@arm.com>

	* tree-ssa-loop-ivopts.c (iv_ca_add_use): Delete parameter
	important_candidates.  Consider all important candidates if
	IVS doesn't give any result.  Remove check on ivs->upto.
	(try_add_cand_for): Call iv_ca_add_use only once.

Attachment: pr62178-clean-20140826.txt
Description: Text document


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