diff mbox

[rs6000] Fine-tune vec_construct direct move cost

Message ID 11780563-05d5-07a5-73cc-93ffe8264c2d@linux.vnet.ibm.com
State New
Headers show

Commit Message

Bill Schmidt July 21, 2017, 3:40 p.m. UTC
Hi,

In https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00924.html, I raised the
vectorization cost for a vec_construct operation that requires direct
moves between GPRs and VSRs.  The cost equation I substituted has since
proven to be slightly more conservative than attended, and we're seeing
some cases of SLP vectorization being avoided that should not be.  This
patch adjusts the equation to reduce the cost somewhat.

I've tested this to ensure the cases previously seen are now being
vectorized again, and done some benchmark testing that shows no measurable
result, positive or negative.  So this is just minor fine-tuning, but
still important to get right.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no regressions.
Is this ok for trunk?

Thanks,
Bill


2017-07-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/80695
	* config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost):
	Reduce cost estimate for direct moves.

Comments

Segher Boessenkool July 21, 2017, 10:25 p.m. UTC | #1
Hi Bill,

On Fri, Jul 21, 2017 at 10:40:43AM -0500, Bill Schmidt wrote:
> In https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00924.html, I raised the
> vectorization cost for a vec_construct operation that requires direct
> moves between GPRs and VSRs.  The cost equation I substituted has since
> proven to be slightly more conservative than attended, and we're seeing
> some cases of SLP vectorization being avoided that should not be.  This
> patch adjusts the equation to reduce the cost somewhat.
> 
> I've tested this to ensure the cases previously seen are now being
> vectorized again, and done some benchmark testing that shows no measurable
> result, positive or negative.  So this is just minor fine-tuning, but
> still important to get right.
> 
> Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no regressions.
> Is this ok for trunk?

Sure, thanks!


Segher
diff mbox

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 250426)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -5757,7 +5757,7 @@  rs6000_builtin_vectorization_cost (enum vect_cost_
 	    if (TARGET_P9_VECTOR)
 	      return TYPE_VECTOR_SUBPARTS (vectype) - 1 + 2;
 	    else
-	      return TYPE_VECTOR_SUBPARTS (vectype) - 1 + 11;
+	      return TYPE_VECTOR_SUBPARTS (vectype) - 1 + 5;
 	  }
 	else
 	  /* V2DFmode doesn't need a direct move.  */