public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1764] Improve SLP codegen, avoiding unnecessary TREE_ADDRESSABLE
@ 2022-07-20 12:05 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-07-20 12:05 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5f59d0f2d9fa921c04d75c39592e603cfa2b1324

commit r13-1764-g5f59d0f2d9fa921c04d75c39592e603cfa2b1324
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Jul 20 11:02:03 2022 +0200

    Improve SLP codegen, avoiding unnecessary TREE_ADDRESSABLE
    
    The following adjusts vectorizer code generation to avoid splitting
    out address increments for invariant addresses which causes objects
    to get TREE_ADDRESSABLE when not necessary.
    
            * tree-vect-data-refs.cc (bump_vector_ptr): Return an
            invariant updated address when the input was invariant.

Diff:
---
 gcc/tree-vect-data-refs.cc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc
index 609cacc4971..b279a82551e 100644
--- a/gcc/tree-vect-data-refs.cc
+++ b/gcc/tree-vect-data-refs.cc
@@ -5195,6 +5195,14 @@ bump_vector_ptr (vec_info *vinfo,
 
   if (TREE_CODE (dataref_ptr) == SSA_NAME)
     new_dataref_ptr = copy_ssa_name (dataref_ptr);
+  else if (is_gimple_min_invariant (dataref_ptr))
+    /* When possible avoid emitting a separate increment stmt that will
+       force the addressed object addressable.  */
+    return build1 (ADDR_EXPR, TREE_TYPE (dataref_ptr),
+		   fold_build2 (MEM_REF,
+				TREE_TYPE (TREE_TYPE (dataref_ptr)),
+				dataref_ptr,
+				fold_convert (ptr_type_node, update)));
   else
     new_dataref_ptr = make_ssa_name (TREE_TYPE (dataref_ptr));
   incr_stmt = gimple_build_assign (new_dataref_ptr, POINTER_PLUS_EXPR,


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-20 12:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20 12:05 [gcc r13-1764] Improve SLP codegen, avoiding unnecessary TREE_ADDRESSABLE Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).