diff mbox

Fix PR63844

Message ID alpine.LSU.2.11.1411191004280.374@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Nov. 19, 2014, 9:07 a.m. UTC
The following improves code-generation for PR63844 by using
a restrict qualified reference type for the OMP receiver decl.
This improves alias analysis and points-to analysis enough to
usually allow invariant and store motion where that was possible
in the non-split-out variant.

Bootstrapped and tested on x86_64-unknown-linux-gnu, ok for trunk?

Sadly I don't have a good testcase (for example one that wasn't
vectorized before but is now).  We can add one later - ISTR there
were a few other bugs about not vectorizing with -fopenmp, I'll
try to find them again and see whether they are fixed.

Thanks,
Richard. 

2014-11-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/63844
	* omp-low.c (fixup_child_record_type): Use a restrict qualified
	referece type for the receiver parameter.

Comments

Jakub Jelinek Nov. 19, 2014, 9:17 a.m. UTC | #1
On Wed, Nov 19, 2014 at 10:07:07AM +0100, Richard Biener wrote:
> 
> The following improves code-generation for PR63844 by using
> a restrict qualified reference type for the OMP receiver decl.
> This improves alias analysis and points-to analysis enough to
> usually allow invariant and store motion where that was possible
> in the non-split-out variant.
> 
> Bootstrapped and tested on x86_64-unknown-linux-gnu, ok for trunk?
> 
> Sadly I don't have a good testcase (for example one that wasn't
> vectorized before but is now).  We can add one later - ISTR there
> were a few other bugs about not vectorizing with -fopenmp, I'll
> try to find them again and see whether they are fixed.

Most of those PRs should have openmp keyword.

> 2014-11-19  Richard Biener  <rguenther@suse.de>
> 
> 	PR tree-optimization/63844
> 	* omp-low.c (fixup_child_record_type): Use a restrict qualified
> 	referece type for the receiver parameter.

Ok, thanks.

> --- gcc/omp-low.c	(revision 217692)
> +++ gcc/omp-low.c	(working copy)
> @@ -1517,7 +1517,8 @@ fixup_child_record_type (omp_context *ct
>        layout_type (type);
>      }
>  
> -  TREE_TYPE (ctx->receiver_decl) = build_pointer_type (type);
> +  TREE_TYPE (ctx->receiver_decl)
> +    = build_qualified_type (build_reference_type (type), TYPE_QUAL_RESTRICT);
>  }
>  
>  /* Instantiate decls as necessary in CTX to satisfy the data sharing

	Jakub
diff mbox

Patch

Index: gcc/omp-low.c
===================================================================
--- gcc/omp-low.c	(revision 217692)
+++ gcc/omp-low.c	(working copy)
@@ -1517,7 +1517,8 @@  fixup_child_record_type (omp_context *ct
       layout_type (type);
     }
 
-  TREE_TYPE (ctx->receiver_decl) = build_pointer_type (type);
+  TREE_TYPE (ctx->receiver_decl)
+    = build_qualified_type (build_reference_type (type), TYPE_QUAL_RESTRICT);
 }
 
 /* Instantiate decls as necessary in CTX to satisfy the data sharing