]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Less strip_offset in IVOPTs
authorRichard Biener <rguenther@suse.de>
Wed, 21 Jun 2023 09:38:19 +0000 (11:38 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 21 Jun 2023 11:38:09 +0000 (13:38 +0200)
This avoids a strip_offset use in record_group_use where we know
it operates on addresses.

* tree-ssa-loop-ivopts.cc (record_group_use): Use
split_constant_offset.

gcc/tree-ssa-loop-ivopts.cc

index 82531f97b9327229a5ad9be4a75cb36f00841ab3..957a3001e16486f36ed1b8b1b7dcb645f29a46e8 100644 (file)
@@ -1175,9 +1175,6 @@ contain_complex_addr_expr (tree expr)
   return res;
 }
 
-static tree
-strip_offset (tree expr, poly_uint64_pod *offset);
-
 /* Allocates an induction variable with given initial value BASE and step STEP
    for loop LOOP.  NO_OVERFLOW implies the iv doesn't overflow.  */
 
@@ -1609,7 +1606,10 @@ record_group_use (struct ivopts_data *data, tree *use_p,
     {
       unsigned int i;
 
-      addr_base = strip_offset (iv->base, &addr_offset);
+      gcc_assert (POINTER_TYPE_P (TREE_TYPE (iv->base)));
+      tree addr_toffset;
+      split_constant_offset (iv->base, &addr_base, &addr_toffset);
+      addr_offset = int_cst_value (addr_toffset);
       for (i = 0; i < data->vgroups.length (); i++)
        {
          struct iv_use *use;