public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2015] Less strip_offset in IVOPTs
@ 2023-06-21 12:01 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-06-21 12:01 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:b54d0f29590d21991f519c5b70cc74e6309aa2f6
commit r14-2015-gb54d0f29590d21991f519c5b70cc74e6309aa2f6
Author: Richard Biener <rguenther@suse.de>
Date: Wed Jun 21 12:08:01 2023 +0200
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:
---
gcc/tree-ssa-loop-ivopts.cc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc
index 957a3001e16..6671ff6db5a 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-21 12:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 12:01 [gcc r14-2015] 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).