From: Richard Biener Date: Wed, 21 Jun 2023 10:08:01 +0000 (+0200) Subject: Less strip_offset in IVOPTs X-Git-Tag: basepoints/gcc-15~8124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b54d0f29590d21991f519c5b70cc74e6309aa2f6;p=thirdparty%2Fgcc.git Less strip_offset in IVOPTs 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. --- diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc index 957a3001e164..6671ff6db5ac 100644 --- a/gcc/tree-ssa-loop-ivopts.cc +++ b/gcc/tree-ssa-loop-ivopts.cc @@ -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