diff options
author | Richard Biener <rguenther@suse.de> | 2023-06-21 12:08:01 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-06-21 13:38:10 +0200 |
commit | b54d0f29590d21991f519c5b70cc74e6309aa2f6 (patch) | |
tree | 46720a419d1610548f5bd45e28f2b6a099ca321a | |
parent | 5d88932657de239a941ad84ef0996a906ecd8fe9 (diff) | |
download | gcc-b54d0f29590d21991f519c5b70cc74e6309aa2f6.zip gcc-b54d0f29590d21991f519c5b70cc74e6309aa2f6.tar.gz gcc-b54d0f29590d21991f519c5b70cc74e6309aa2f6.tar.bz2 |
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.
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc index 957a300..6671ff6 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 |