[committed,nvptx] Apply vector-partitionable routines workaround to default vl

Message ID 20190112103928.GA11549@delia
State New
Headers show
Series
  • [committed,nvptx] Apply vector-partitionable routines workaround to default vl
Related show

Commit Message

Tom de Vries Jan. 12, 2019, 10:39 a.m.
Hi,

Make "[nvptx] Force vl32 if calling vector-partitionable routines" work as well
if vector length is set by modifying PTX_DEFAULT_VECTOR_LENGTH.

Committed to trunk.

Thanks,
- Tom

[nvptx] Apply vector-partitionable routines workaround to default vl

2019-01-11  Tom de Vries  <tdevries@suse.de>

	* config/nvptx/nvptx.c (nvptx_goacc_validate_dims_1): In offloading
	region calling vector-partitionable routine, set default_vector_length
	to WARP_SIZE.

---
 gcc/config/nvptx/nvptx.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 95d72d0a4e0..1d9704543d9 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -5669,6 +5669,8 @@  nvptx_goacc_validate_dims_1 (tree decl, int dims[], int fn_level, unsigned used)
   const char *vector_reason = NULL;
   if (offload_region_p && has_vector_partitionable_routine_calls_p (decl))
     {
+      default_vector_length = PTX_WARP_SIZE;
+
       if (dims[GOMP_DIM_VECTOR] > PTX_WARP_SIZE)
 	{
 	  vector_reason = G_("using vector_length (%d) due to call to"