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

* tree-ssa-loop-ivopts.cc (add_iv_candidate_for_use): Use
split_constant_offset for the POINTER_PLUS_EXPR case.

gcc/tree-ssa-loop-ivopts.cc

index 957a3001e16486f36ed1b8b1b7dcb645f29a46e8..6671ff6db5ac339d1b264ba6f7e303264c63795d 100644 (file)
@@ -3585,9 +3585,10 @@ add_iv_candidate_for_use (struct ivopts_data *data, struct iv_use *use)
       step = fold_convert (sizetype, step);
       record_common_cand (data, base, step, use);
       /* Also record common candidate with offset stripped.  */
-      base = strip_offset (base, &offset);
-      if (maybe_ne (offset, 0U))
-       record_common_cand (data, base, step, use);
+      tree alt_base, alt_offset;
+      split_constant_offset (base, &alt_base, &alt_offset);
+      if (!integer_zerop (alt_offset))
+       record_common_cand (data, alt_base, step, use);
     }
 
   /* At last, add auto-incremental candidates.  Make such variables