]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix mixed input kind permute optimization
authorRichard Biener <rguenther@suse.de>
Tue, 21 May 2024 17:15:33 +0000 (19:15 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 22 May 2024 11:18:28 +0000 (13:18 +0200)
When change_vec_perm_layout runs into a permute combining two
nodes where one is invariant and one internal the partition of
one input can be -1 but the other might not be.  The following
supports this case by simply ignoring inputs with input partiton -1.

I'm not sure this is correct but it avoids ICEing when accessing
that partitions layout for gcc.target/i386/pr98928.c with the
change to avoid splitting store dataref groups during SLP discovery.

* tree-vect-slp.cc (change_vec_perm_layout): Ignore an
input partition of -1.

gcc/tree-vect-slp.cc

index 43f2c153bf0c5b298bf33e7c05058874cb74cbc4..3f8209b43a756645d7e7a9825e6b11e045c4d802 100644 (file)
@@ -4640,6 +4640,8 @@ change_vec_perm_layout (slp_tree node, lane_permutation_t &perm,
        {
          slp_tree in_node = SLP_TREE_CHILDREN (node)[entry.first];
          unsigned int in_partition_i = m_vertices[in_node->vertex].partition;
+         if (in_partition_i == -1u)
+           continue;
          this_in_layout_i = m_partitions[in_partition_i].layout;
        }
       if (this_in_layout_i > 0)