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.
This commit is contained in:
Richard Biener 2023-06-21 12:08:01 +02:00
parent 5d88932657
commit b54d0f2959

View 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