public inbox for
 help / color / mirror / Atom feed
From: Richard Biener <>
Subject: [PATCH 3/3] Less strip_offset in IVOPTs
Date: Wed, 21 Jun 2023 11:31:21 +0000 (UTC)	[thread overview]
Message-ID: <20230621113121.tQeFY15laAUt4suvqaQZWsFLMT_c5uqIVe-M7jwSXSI@z> (raw)

This avoids one strip_offset use in add_iv_candidate_for_use where
we know it operates on a sizetype quantity.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

	* (add_iv_candidate_for_use): Use
	split_constant_offset for the POINTER_PLUS_EXPR case.
 gcc/ | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/ b/gcc/
index 65caf382bba..03161813e0a 100644
--- a/gcc/
+++ b/gcc/
@@ -3588,8 +3588,9 @@ 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.  */
-      tree alt_base = strip_offset (base);
-      if (alt_base != base)
+      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);

                 reply	other threads:[~2023-06-21 11:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230621113121.tQeFY15laAUt4suvqaQZWsFLMT_c5uqIVe-M7jwSXSI@z \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).