PR tree-optimization/62178
	* tree-ssa-loop-ivopts.c (cheaper_cost_with_cand): New function.
	(iv_ca_replace): New function.
	(try_improve_iv_set): New parameter try_replace_p.
	Break local optimal fixed-point by calling iv_ca_replace.
	(find_optimal_iv_set_1): Pass new argument to try_improve_iv_set.

	gcc/testsuite/ChangeLog
	PR tree-optimization/62178
	* gcc.target/aarch64/pr62178.c: New test.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218855 138bc75d-0d04-0410-961f-82ee72b054a4