rs6000: Parameterize some const values for density test
authorKewen Lin <linkw@linux.ibm.com>
Wed, 22 Sep 2021 03:25:54 +0000 (22:25 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Wed, 22 Sep 2021 04:47:33 +0000 (23:47 -0500)
commit144c4984655e9c687dfdda6b1ac39afea8b2a037
tree9ab6e1e1de670ebdb32745ef841a6a93374578f6
parent72394d38d929c72cad6cf706a0e790b5934f2bf1
rs6000: Parameterize some const values for density test

This patch follows the discussion here[1], where Segher suggested
parameterizing those exact magic constants for density heuristics,
to make it easier to tweak if need.

The change here should be "No Functional Change".  But I verified
it with SPEC2017 at option sets O2-vect and Ofast-unroll on Power8,
the result is neutral as expected.

[1]https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579121.html

gcc/ChangeLog:

* config/rs6000/rs6000.opt (rs6000-density-pct-threshold,
rs6000-density-size-threshold, rs6000-density-penalty,
rs6000-density-load-pct-threshold,
rs6000-density-load-num-threshold): New parameter.
* config/rs6000/rs6000.c (rs6000_density_test): Adjust with
corresponding parameters.
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.opt