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: PR80218: Call CDCE fails to update the block profile


On 03/28/2017 06:45 AM, Richard Sandiford wrote:
tree-call-cdce.c was updating the edge probabilities and counts but
it wasn't updating the corresponding block information.  Among other
things, this tricked the register allocator into thinking that the
libm call was relatively hot and that it wasn't worth assigning
call-clobbered registers to values that were live across the call.
With correct frequency information, the RA instead keeps x in the
first argument register and spills it only around the call.

Although the problem has been around for a long time, it became more
acute (and would only trigger for the first function in the testcase)
after r230488.  Until that patch, the code was specific to calls that
had no lhs, but that we still had to keep for their effect on errno.
After the patch we also used the code for calls with an lhs, provided
that the hardware could calculate the lhs directly.

This showed up as a significant performance drop in an internal
benchmark from GCC 5 to GCC 6.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK for trunk
and gcc-6-branch?

Thanks,
Richard


gcc/
	PR tree-optimization/80218
	* tree-call-cdce.c (shrink_wrap_one_built_in_call_with_conds):
	Update block frequencies and counts.

gcc/testsuite/
	PR tree-optimization/80218
	* gcc.dg/pr80218.c: New test.

OK.  I went ahead and installed this for you.

Thanks,
Jeff


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