* [PATCH 3/3] Less strip_offset in IVOPTs
@ 2023-06-21 11:31 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-06-21 11:31 UTC (permalink / raw)
To: gcc-patches
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.
* 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 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc
index 65caf382bba..03161813e0a 100644
--- a/gcc/tree-ssa-loop-ivopts.cc
+++ b/gcc/tree-ssa-loop-ivopts.cc
@@ -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);
}
--
2.35.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-21 11:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 11:31 [PATCH 3/3] Less strip_offset in IVOPTs Richard Biener
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).