[gcc r15-1707] Remove unused hybrid_* operators in range-ops.

2024-06-28 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:e9aa97940c60cbd43f28d8b1292126e118ead1d9 commit r15-1707-ge9aa97940c60cbd43f28d8b1292126e118ead1d9 Author: Aldy Hernandez Date: Fri Jun 28 11:27:24 2024 +0200 Remove unused hybrid_* operators in range-ops. gcc/ChangeLog: * range-op-ptr.cc

[PATCH] Remove unused hybrid_* operators in range-ops.

2024-06-28 Thread Aldy Hernandez
Now that the dust has settled on the prange work, we can remove the hybrid operators. I will push this once tests complete. gcc/ChangeLog: * range-op-ptr.cc (class hybrid_and_operator): Remove. (class hybrid_or_operator): Same. (class hybrid_min_operator): Same.

[gcc r15-1691] Avoid global bitmap space in ranger.

2024-06-27 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:bcdbb85f26aa0d25645d51ddf728a049b201c980 commit r15-1691-gbcdbb85f26aa0d25645d51ddf728a049b201c980 Author: Aldy Hernandez Date: Wed Jun 19 11:42:16 2024 +0200 Avoid global bitmap space in ranger. gcc/ChangeLog: * gimple-range-cache.cc

Re: [PATCH] middle-end/114604 - ranger allocates bitmap without initialized obstack

2024-06-26 Thread Aldy Hernandez
On 6/20/24 4:36 PM, Richard Biener wrote: Am 20.06.2024 um 16:05 schrieb Andrew MacLeod :  On 6/20/24 05:31, Richard Biener wrote: On Thu, 20 Jun 2024, Aldy Hernandez wrote: Hi. I came around to this, and whipped up the proposed patch. However, it does seem a bit verbose, and I'm

Re: [PATCH] middle-end/114604 - ranger allocates bitmap without initialized obstack

2024-06-20 Thread Aldy Hernandez
/most of the local obstacks we use in ranger, and just use the global (NULL) one? Thoughts? Aldy On Mon, Apr 8, 2024 at 7:47 PM Richard Biener wrote: > > > > > Am 08.04.2024 um 18:40 schrieb Aldy Hernandez : > > > > On Mon, Apr 8, 2024 at 6:29 PM Richard Biener wrot

[COMMITTED] Rename Value_Range to value_range.

2024-06-17 Thread Aldy Hernandez
Now that all remaining users of value_range have been renamed to int_range<>, we can reclaim value_range as a temporary, thus removing the annoying CamelCase. gcc/ChangeLog: * data-streamer-in.cc (streamer_read_value_range): Rename Value_Range to value_range. *

[gcc r15-1372] Rename Value_Range to value_range.

2024-06-17 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:3dedfad5a1edb14169a138492e486ee691387a53 commit r15-1372-g3dedfad5a1edb14169a138492e486ee691387a53 Author: Aldy Hernandez Date: Tue Jun 4 07:35:51 2024 +0200 Rename Value_Range to value_range. Now that all remaining users of value_range have been renamed

[gcc r15-992] Remove value_range typedef.

2024-06-03 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:6fb43d1b90e2683f6f41f04a65341fc2dab4b495 commit r15-992-g6fb43d1b90e2683f6f41f04a65341fc2dab4b495 Author: Aldy Hernandez Date: Fri May 31 15:49:26 2024 +0200 Remove value_range typedef. Now that pointers and integers have been disambiguated from irange

[COMMITTED] Remove value_range typedef.

2024-06-03 Thread Aldy Hernandez
Now that pointers and integers have been disambiguated from irange, and all the pointer range temporaries use prange, we can reclaim value_range as a general purpose range container. This patch removes the typedef, in favor of int_range_max, thus providing slightly better ranges in places. I

[COMMITTED] [prange] Use type agnostic range in phiopt [PR115191]

2024-05-23 Thread Aldy Hernandez
Fix a use of int_range_max in phiopt that should be a type agnostic range, because it could be either a pointer or an int. PR tree-optimization/115191 gcc/ChangeLog: * tree-ssa-phiopt.cc (value_replacement): Use Value_Range instead of int_range_max.

[gcc r15-785] [prange] Use type agnostic range in phiopt [PR115191]

2024-05-23 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:35a293a6454ac0cd88735036f536d8f4ec65951a commit r15-785-g35a293a6454ac0cd88735036f536d8f4ec65951a Author: Aldy Hernandez Date: Wed May 22 22:32:57 2024 +0200 [prange] Use type agnostic range in phiopt [PR115191] Fix a use of int_range_max in phiopt

[COMMITTED] [prange] Drop range to VARYING if the bitmask intersection made it so [PR115131]

2024-05-17 Thread Aldy Hernandez
If the intersection of the bitmasks made the range span the entire domain, normalize the range to VARYING. gcc/ChangeLog: PR middle-end/115131 * value-range.cc (prange::intersect): Set VARYING if intersection of bitmasks made the range span the entire domain.

[gcc r15-632] [prange] Drop range to VARYING if the bitmask intersection made it so [PR115131]

2024-05-17 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:1accf4454a2ab57c4d681d1f6db332c46c61c058 commit r15-632-g1accf4454a2ab57c4d681d1f6db332c46c61c058 Author: Aldy Hernandez Date: Fri May 17 13:44:08 2024 +0200 [prange] Drop range to VARYING if the bitmask intersection made it so [PR115131

[COMMITTED] [prange] Avoid looking at type() for undefined ranges

2024-05-17 Thread Aldy Hernandez
Undefined ranges have no type. This patch fixes the thinko. gcc/ChangeLog: PR middle-end/115128 * ipa-cp.cc (ipa_value_range_from_jfunc): Check for undefined_p before looking at type. (propagate_vr_across_jump_function): Same. gcc/testsuite/ChangeLog: *

[gcc r15-627] [prange] Avoid looking at type() for undefined ranges

2024-05-17 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:bc6e336cb7c85094ddc77757be97c3d8588f35ca commit r15-627-gbc6e336cb7c85094ddc77757be97c3d8588f35ca Author: Aldy Hernandez Date: Fri May 17 10:30:03 2024 +0200 [prange] Avoid looking at type() for undefined ranges Undefined ranges have no type. This patch

Re: [COMMITTED] Revert "Revert: "Enable prange support.""

2024-05-16 Thread Aldy Hernandez
01e12f7. etc etc. Next time, would you like me to add manual changelog entries? My apologies, I thought what I did was the blessed way of doing things. Aldy On Thu, May 16, 2024 at 12:08 PM Jakub Jelinek wrote: > > On Thu, May 16, 2024 at 12:01:01PM +0200,

[COMMITTED] Revert "Revert: "Enable prange support.""

2024-05-16 Thread Aldy Hernandez
This reverts commit d7bb8eaade3cd3aa70715c8567b4d7b08098e699 and enables prange support again. --- gcc/gimple-range-cache.cc | 4 ++-- gcc/gimple-range-fold.cc | 4 ++-- gcc/gimple-range-fold.h | 2 +- gcc/gimple-range-infer.cc | 2 +- gcc/gimple-range-op.cc| 2 +-

[COMMITTED] Use a boolean type when folding conditionals in simplify_using_ranges.

2024-05-16 Thread Aldy Hernandez
In adding some traps for PR114985 I noticed that the conditional folding code in simplify_using_ranges was using the wrong type. This cleans up the oversight. gcc/ChangeLog: PR tree-optimization/114985 * vr-values.cc (simplify_using_ranges::fold_cond_with_ops): Use

[COMMITTED] Cleanup prange sanity checks.

2024-05-16 Thread Aldy Hernandez
The pointers_handled_p() code was a temporary sanity check, and not even a good one, since we have a cleaner way of checking type mismatches with operand_check_p. This patch removes all the code, and adds an explicit type check for relational operators, which are the main problem in PR114985.

[gcc r15-575] Revert "Revert: "Enable prange support.""

2024-05-16 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:da73261ce7731be7f2b164f1db796878cdc23365 commit r15-575-gda73261ce7731be7f2b164f1db796878cdc23365 Author: Aldy Hernandez Date: Fri May 10 00:38:51 2024 +0200 Revert "Revert: "Enable prange support.""

[gcc r15-574] Cleanup prange sanity checks.

2024-05-16 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:b8e3574e68310f68116f157a35d5650600d13718 commit r15-574-gb8e3574e68310f68116f157a35d5650600d13718 Author: Aldy Hernandez Date: Thu May 16 09:47:56 2024 +0200 Cleanup prange sanity checks. The pointers_handled_p() code was a temporary sanity check

[gcc r15-573] Use a boolean type when folding conditionals in simplify_using_ranges.

2024-05-16 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:f6bed6d3fcc13880ffa786b6c616e2306efe2bf3 commit r15-573-gf6bed6d3fcc13880ffa786b6c616e2306efe2bf3 Author: Aldy Hernandez Date: Thu May 16 09:22:55 2024 +0200 Use a boolean type when folding conditionals in simplify_using_ranges. In adding some traps

Re: [PATCH] Adjust range type of calls into fold_range for IPA passes [PR114985]

2024-05-15 Thread Aldy Hernandez
Any thoughts on this? If no one objects, I'll re-enable prange tomorrow. Aldy On Sat, May 11, 2024 at 11:43 AM Aldy Hernandez wrote: > > I have pushed a few cleanups to make it easier to move forward without > disturbing passes which are affected by IPA's mixing up the range >

[COMMITTED] [prange] Default pointers_handled_p() to false.

2024-05-15 Thread Aldy Hernandez
The pointers_handled_p() method is an internal range-op helper to help catch dispatch type mismatches for pointer operands. This is what caught the IPA mismatch in PR114985. This method is only a temporary measure to catch any incompatibilities in the current pointer range-op entries. This

[gcc r15-504] [prange] Default pointers_handled_p() to false.

2024-05-15 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:c400b2100719d0a9e5989c63e0827b9e98919df3 commit r15-504-gc400b2100719d0a9e5989c63e0827b9e98919df3 Author: Aldy Hernandez Date: Tue May 14 16:21:50 2024 +0200 [prange] Default pointers_handled_p() to false. The pointers_handled_p() method is an internal range

Re: [PATCHv2] Value range: Add range op for __builtin_isfinite

2024-05-13 Thread Aldy Hernandez
On Thu, May 9, 2024 at 10:05 AM Mikael Morin wrote: > > Hello, > > Le 07/05/2024 à 04:37, HAO CHEN GUI a écrit : > > Hi, > >The former patch adds isfinite optab for __builtin_isfinite. > > https://gcc.gnu.org/pipermail/gcc-patches/2024-April/649339.html > > > >Thus the builtin might not

Re: [PATCH] Adjust range type of calls into fold_range for IPA passes [PR114985]

2024-05-11 Thread Aldy Hernandez
, for the above 4 architectures things work as before, and we have a PR to track the IPA problem which doesn't seem to affect neither bootstrap nor tests. Does this sound reasonable? Aldy On Fri, May 10, 2024 at 12:26 PM Richard Biener wrote: > > On Fri, May 10, 2024 at 11:24 AM Aldy Hernandez

Re: [COMMITTED] [prange] Do not trap by default on range dispatch mismatches.

2024-05-11 Thread Aldy Hernandez
For the record, we have always returned false (VARYING) for unsupported range operators. This patch just restores the behavior we've always had, while adding a knob for further analysis (for example. IPA which is getting its range types mixed up). Aldy On Sat, May 11, 2024 at 11:28 AM Aldy

[COMMITTED] [prange] Default unimplemented prange operators to false.

2024-05-11 Thread Aldy Hernandez
The canonical way to indicate that a range operator is unsupported is to return false, which has the sematic meaning of VARYING. This patch cleans up a few default virtuals that were trying harder to set VARYING manually. gcc/ChangeLog: * range-op-ptr.cc (range_operator::fold_range):

[COMMITTED] [prange] Do not trap by default on range dispatch mismatches.

2024-05-11 Thread Aldy Hernandez
The trap in the range-op dispatch code is really an internal debugging aid, and only a temporary one for a few weeks while the dust settles. This patch turns it off by default, allowing problematic passes to turn it on for analysis. gcc/ChangeLog: * range-op.cc

[gcc r15-379] [prange] Default unimplemented prange operators to false.

2024-05-11 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:18c93c65a9fbaaf3762198e78fb3c24b9b6fd9fc commit r15-379-g18c93c65a9fbaaf3762198e78fb3c24b9b6fd9fc Author: Aldy Hernandez Date: Fri May 10 18:55:34 2024 +0200 [prange] Default unimplemented prange operators to false. The canonical way to indicate that a range

[gcc r15-378] [prange] Do not trap by default on range dispatch mismatches.

2024-05-11 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:45ef24f2702dac4f8707ca682ed364019ee90c44 commit r15-378-g45ef24f2702dac4f8707ca682ed364019ee90c44 Author: Aldy Hernandez Date: Fri May 10 23:21:29 2024 +0200 [prange] Do not trap by default on range dispatch mismatches. The trap in the range-op dispatch code

[COMMITTED] [prange] Fix thinko in prange::update_bitmask() [PR115026]

2024-05-10 Thread Aldy Hernandez
gcc/ChangeLog: PR tree-optimization/115026 * value-range.cc (prange::update_bitmask): Use operand bitmask. --- gcc/value-range.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 3e1ecf69517..5bcb2c3f650 100644 ---

[gcc r15-363] [prange] Fix thinko in prange::update_bitmask() [PR115026]

2024-05-10 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:cbd420a1c3e2bb549dc83b53cc9a31aa6b23952c commit r15-363-gcbd420a1c3e2bb549dc83b53cc9a31aa6b23952c Author: Aldy Hernandez Date: Fri May 10 12:26:49 2024 +0200 [prange] Fix thinko in prange::update_bitmask() [PR115026] gcc/ChangeLog: PR tree

Re: [PATCH] Adjust range type of calls into fold_range for IPA passes [PR114985]

2024-05-10 Thread Aldy Hernandez
I would much prefer the IPA experts to fix the pass, but I'm afraid I don't understand the code enough to do so. Could someone lend a hand here? Aldy On Fri, May 10, 2024 at 12:26 PM Richard Biener wrote: > > On Fri, May 10, 2024 at 11:24 AM Aldy Hernandez wrote: > > > >

[PATCH] Adjust range type of calls into fold_range for IPA passes [PR114985]

2024-05-10 Thread Aldy Hernandez
There are various calls into fold_range() that have the wrong type associated with the range temporary used to hold the result. This used to work, because we could store either integers or pointers in a Value_Range, but is no longer the case with prange's. Now you must explicitly state which

[COMMITTED] [prange] Do not assume all pointers are the same size [PR115009]

2024-05-10 Thread Aldy Hernandez
In a world with same sized pointers we can always reuse the storage slots, but since this is not always the case, we need to be more careful. However, we can always store an undefined, because that requires no extra storage. gcc/ChangeLog: PR tree-optimization/115009 *

[gcc r15-357] [prange] Do not assume all pointers are the same size [PR115009]

2024-05-10 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:ac255c7afeb8a558bd6224ff77277eebcd849d6e commit r15-357-gac255c7afeb8a558bd6224ff77277eebcd849d6e Author: Aldy Hernandez Date: Thu May 9 23:37:30 2024 +0200 [prange] Do not assume all pointers are the same size [PR115009] In a world with same sized pointers

[COMMITTED] Revert: "Enable prange support." [PR114985]

2024-05-09 Thread Aldy Hernandez
This reverts commit 36e877996936abd8bd08f8b1d983c8d1023a5842 until the IPA pass is fixed with regards to POINTER = POINTER POINTER. --- gcc/gimple-range-cache.cc | 4 ++-- gcc/gimple-range-fold.cc | 4 ++-- gcc/gimple-range-fold.h | 2 +- gcc/gimple-range-infer.cc | 2 +-

[gcc r15-353] Revert: "Enable prange support." [PR114985]

2024-05-09 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:d7bb8eaade3cd3aa70715c8567b4d7b08098e699 commit r15-353-gd7bb8eaade3cd3aa70715c8567b4d7b08098e699 Author: Aldy Hernandez Date: Fri May 10 00:29:13 2024 +0200 Revert: "Enable prange support." [PR114985] This reve

Re: [COMMITTED] Enable prange support.

2024-05-09 Thread Aldy Hernandez
This is: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114985 I have proposed a patch but need confirmation from the IPA folks. Aldy On Thu, May 9, 2024 at 10:08 AM Andreas Schwab wrote: > > Breaks bootstrap on aarch64. > > $ /opt/gcc/gcc-20240509/Build/./prev-gcc/xg++ >

Re: [PATCH] [ranger] Force buffer alignment in Value_Range [PR114912]

2024-05-08 Thread Aldy Hernandez
Pushed to trunk to unblock sparc. On Fri, May 3, 2024 at 4:24 PM Aldy Hernandez wrote: > > Ahh, that is indeed cleaner, and there's no longer a need to assert > the sizeof of individual ranges. > > It looks like a default constructor is needed for the buffer now, but > on

[gcc r15-336] [ranger] Force buffer alignment in Value_Range [PR114912]

2024-05-08 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:d7ff8ae5313bea755f5960786b33a7b151e7b663 commit r15-336-gd7ff8ae5313bea755f5960786b33a7b151e7b663 Author: Aldy Hernandez Date: Fri May 3 11:17:32 2024 +0200 [ranger] Force buffer alignment in Value_Range [PR114912] gcc/ChangeLog: PR tree

[gcc r15-335] [prange] Reword dispatch error message

2024-05-08 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:be3df704ce7de417682d57bc3e819dfcf0fdd501 commit r15-335-gbe3df704ce7de417682d57bc3e819dfcf0fdd501 Author: Aldy Hernandez Date: Wed May 8 22:50:22 2024 +0200 [prange] Reword dispatch error message After reading the ICE for the PR, it's obvious the error

[COMMITTED] [prange] Reword dispatch error message [PR114985]

2024-05-08 Thread Aldy Hernandez
After reading the ICE for the PR, it's obvious the error message is rather cryptic. This makes it less so. gcc/ChangeLog: * range-op.cc (range_op_handler::discriminator_fail): Reword error message. --- gcc/range-op.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

Re: [PATCH 3/4] ranger: Revert the workaround introduced in PR112788 [PR112993]

2024-05-08 Thread Aldy Hernandez
I'll defer to the PPC maintainers, but LGTM. The less special casing, the better. Aldy On Wed, May 8, 2024, 07:33 Kewen.Lin wrote: > Hi, > > This reverts commit r14-6478-gfda8e2f8292a90 "range: > Workaround different type precision between _Float128 and > long double [PR112788]" as the fixes

[gcc r15-312] Enable prange support.

2024-05-08 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:36e877996936abd8bd08f8b1d983c8d1023a5842 commit r15-312-g36e877996936abd8bd08f8b1d983c8d1023a5842 Author: Aldy Hernandez Date: Tue May 7 14:05:50 2024 +0200 Enable prange support. This throws the switch on prange. After this patch, it is no longer valid

[COMMITTED] Enable prange support.

2024-05-08 Thread Aldy Hernandez
This throws the switch on prange. After this patch, it is no longer valid to store a pointer in an irange (or vice versa). Instead, they must go in prange, which is faster and more memory efficient. I will push this now, so I have time to do any follow-up bugfixing before going on paternity

Re: [PATCH] Minor range type fixes for IPA in preparation for prange.

2024-05-07 Thread Aldy Hernandez
Pushed to trunk. On Sun, Apr 28, 2024 at 10:10 PM Aldy Hernandez wrote: > > The polymorphic Value_Range object takes a tree type at construction > so it can determine what type of range to use (currently irange or > frange). It seems a few of the types are slightly off. This isn't

[gcc r15-270] Minor range type fixes for IPA in preparation for prange.

2024-05-07 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:24853cd854eb9b8a5c7b9706ad0908221bf964ce commit r15-270-g24853cd854eb9b8a5c7b9706ad0908221bf964ce Author: Aldy Hernandez Date: Tue Mar 19 17:55:58 2024 +0100 Minor range type fixes for IPA in preparation for prange. The polymorphic Value_Range object takes

Re: [PATCH] Minor range type fixes for IPA in preparation for prange.

2024-05-05 Thread Aldy Hernandez
PING. I can probably commit this patchlet as a ranger maintainer, but I'd prefer a nod from a global or IPA maintainer. It is the one patch that's needed before I can throw the switch on prange support later this week. Thanks. Aldy On Sun, Apr 28, 2024 at 10:10 PM Aldy Hernandez wrote

[COMMITTED 21/23] Implement operator_gt for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_gt::fold_range): New. (operator_gt::op1_range): New. (operator_gt::op2_range): New. (operator_gt::op1_op2_relation): New.

[COMMITTED 18/23] Implement operator_equal for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_equal::fold_range): New. (operator_equal::op1_range): New. (operator_equal::op2_range): New. (operator_equal::op1_op2_relation): New.

[COMMITTED 22/23] Implement operator_ge for prange....

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_ge::fold_range): New. (operator_ge::op1_range): New. (operator_ge::op2_range): New. (operator_ge::op1_op2_relation): New.

[COMMITTED 08/23] Implement operator_identity for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for fold_range, op1_range, lhs_op1_relation, pointers_handled_p. * range-op-ptr.cc (operator_identity::fold_range): New. (operator_identity::lhs_op1_relation): New.

[COMMITTED 14/23] Implement operator_pointer_diff for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-ptr.cc (operator_pointer_diff::op1_op2_relation_effect): New. (operator_pointer_diff::pointers_handled_p): New. --- gcc/range-op-ptr.cc | 32 1 file changed, 32 insertions(+) diff --git a/gcc/range-op-ptr.cc

[COMMITTED 23/23] Add prange entries in gimple-range-op.cc.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * gimple-range-op.cc (class cfn_pass_through_arg1): Add overloads for prange operations. (cfn_strlen): Same. --- gcc/gimple-range-op.cc | 36 1 file changed, 36 insertions(+) diff --git a/gcc/gimple-range-op.cc

[COMMITTED 20/23] Implement operator_le for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_le::fold_range): New. (operator_le::op1_range): New. (operator_le::op2_range): New. (operator_le::op1_op2_relation): New.

[COMMITTED 11/23] Implement operator_min and operator_max for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_min::fold_range): New. (operator_min::pointers_handled_p): New. (operator_max::fold_range): New. (operator_max::pointers_handled_p): New. ---

[COMMITTED 09/23] Implement operator_cst for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_cst::fold_range): New. (operator_cst::pointers_handled_p): New. --- gcc/range-op-mixed.h | 4 gcc/range-op-ptr.cc | 23 +++ 2 files

[COMMITTED 17/23] Implement operator_not_equal for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_not_equal::fold_range): New. (operator_not_equal::op1_range): New. (operator_not_equal::op2_range): New. (operator_not_equal::op1_op2_relation):

[COMMITTED 06/23] Add prange implementation for get_legacy_range.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * value-range.cc (get_legacy_range): New version for prange. --- gcc/value-range.cc | 35 +-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 62170a438bf..3e1ecf69517 100644 ---

[COMMITTED 19/23] Implement operator_lt for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (max_limit): New. (min_limit): New. (build_lt): New. (build_le): New. (build_gt): New. (build_ge): New. (operator_lt::fold_range):

[COMMITTED 12/23] Implement operator_addr_expr for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_addr_expr::op1_range): New. (operator_addr_expr::pointers_handled_p): New. --- gcc/range-op-mixed.h | 4 gcc/range-op-ptr.cc | 38

[COMMITTED 10/23] Implement operator_cast for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_cast::fold_range): New. (operator_cast::op1_range): New. (operator_cast::lhs_op1_relation): New. (operator_cast::pointers_handled_p): New. ---

[COMMITTED 13/23] Implement pointer_plus_operator for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-ptr.cc (class pointer_plus_operator): Add overloaded declarations for pointer variants. (pointer_plus_operator::fold_range): New. (pointer_plus_operator::op2_range): New. (pointer_plus_operator::pointers_handled_p): New. ---

[COMMITTED 15/23] Implement operator_bitwise_and for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_bitwise_and::fold_range): New. (operator_bitwise_and::pointers_handled_p): New. --- gcc/range-op-mixed.h | 6 ++ gcc/range-op-ptr.cc | 30

[COMMITTED 16/23] Implement operator_bitwise_or for prange.

2024-05-04 Thread Aldy Hernandez
We seem to have a range-op entry for pointer bitwise OR that we've inherited from the original VRP implementation, but it never gets used. If this is not valid gimple, we can safely remove this entry. gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants.

[COMMITTED 05/23] Add hashing support for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * value-range.cc (add_vrange): Add prange support. --- gcc/value-range.cc | 16 1 file changed, 16 insertions(+) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 84113ccfbd0..62170a438bf 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc

[COMMITTED 01/23] Minimal prange class showing inlining degradation to VRP.

2024-05-04 Thread Aldy Hernandez
There is a 2% slowdown to VRP unrelated to the work at hand. This patch is a skeleton implementation of prange that exhibits this degradation. It is meant as a place in the commit history we can return to in order to revisit the issue. The relevant discussion is here:

[COMMITTED 07/23] Implement range-op dispatch for prange.

2024-05-04 Thread Aldy Hernandez
This patch adds the range-op dispatch code for prange, and adds some temporary sanity checks (for flag_checking only) to make sure we handle all the pointer/integer variants. In order to make sure I got all the combinations right, I started with a clean slate, trapping on all pointer operands.

[COMMITTED 02/23] Implement basic prange class.

2024-05-04 Thread Aldy Hernandez
This provides a bare prange class with bounds and bitmasks. It will be a drop-in replacement for pointer ranges, so we can pull their support from irange. The range-op code will be contributed as a follow-up. The code is disabled by default, as irange::supports_p still accepts pointers: inline

[COMMITTED 04/23] Add storage support for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * value-range-storage.cc (vrange_allocator::clone_varying): Add prange support. (vrange_allocator::clone_undefined): Same. (vrange_storage::alloc): Same. (vrange_storage::set_vrange): Same. (vrange_storage::get_vrange): Same.

[PATCH 00/23] prange: pointer ranges

2024-05-04 Thread Aldy Hernandez
/pipermail/gcc-patches/2024-May/650320.html So things are looking relatively good. The memory usage will also decrease, both by the 14% reduction in Value_Range, and by prange's being smaller than say int_range_max or int_range<3>. Tested and benchmarked on x86-64 Linux. Aldy Hernand

[COMMITTED 03/23] Add streaming support for prange.

2024-05-04 Thread Aldy Hernandez
gcc/ChangeLog: * data-streamer-in.cc (streamer_read_value_range): Add prange support. * data-streamer-out.cc (streamer_write_vrange): Same. --- gcc/data-streamer-in.cc | 12 gcc/data-streamer-out.cc | 10 ++ 2 files changed, 22 insertions(+) diff --git

[gcc r15-164] Add prange entries in gimple-range-op.cc.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:6cec31d44a426fa031ca07266fd2723b0038de83 commit r15-164-g6cec31d44a426fa031ca07266fd2723b0038de83 Author: Aldy Hernandez Date: Wed Mar 20 11:27:21 2024 +0100 Add prange entries in gimple-range-op.cc. gcc/ChangeLog: * gimple-range-op.cc

[gcc r15-163] Implement operator_ge for prange....

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:ff306c77b7cf5b7b09914f38b7351328835ac4ce commit r15-163-gff306c77b7cf5b7b09914f38b7351328835ac4ce Author: Aldy Hernandez Date: Wed Mar 20 11:15:03 2024 +0100 Implement operator_ge for prange gcc/ChangeLog: * range-op-mixed.h: Add

[gcc r15-162] Implement operator_gt for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:76fae4051a72b2d417d50f1980dff8ab0c50d0c5 commit r15-162-g76fae4051a72b2d417d50f1980dff8ab0c50d0c5 Author: Aldy Hernandez Date: Wed Mar 20 11:10:03 2024 +0100 Implement operator_gt for prange. gcc/ChangeLog: * range-op-mixed.h: Add overloaded

[gcc r15-161] Implement operator_le for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:3a4ee6ea8627efe0d34a71d0ea4ce9b70d34df18 commit r15-161-g3a4ee6ea8627efe0d34a71d0ea4ce9b70d34df18 Author: Aldy Hernandez Date: Wed Mar 20 11:07:30 2024 +0100 Implement operator_le for prange. gcc/ChangeLog: * range-op-mixed.h: Add overloaded

[gcc r15-160] Implement operator_lt for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:bfa2323d1ddf96a4f40a26aa39b8e1e3bd9b6d98 commit r15-160-gbfa2323d1ddf96a4f40a26aa39b8e1e3bd9b6d98 Author: Aldy Hernandez Date: Wed Mar 20 11:03:24 2024 +0100 Implement operator_lt for prange. gcc/ChangeLog: * range-op-mixed.h: Add overloaded

[gcc r15-158] Implement operator_not_equal for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:d1be4c907fa47d868d6ef31e8fd7ede0535420ca commit r15-158-gd1be4c907fa47d868d6ef31e8fd7ede0535420ca Author: Aldy Hernandez Date: Wed Mar 20 10:49:11 2024 +0100 Implement operator_not_equal for prange. gcc/ChangeLog: * range-op-mixed.h: Add

[gcc r15-159] Implement operator_equal for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:bcb226924f50d9b84ca32b6f39abb63b43e23229 commit r15-159-gbcb226924f50d9b84ca32b6f39abb63b43e23229 Author: Aldy Hernandez Date: Wed Mar 20 10:54:39 2024 +0100 Implement operator_equal for prange. gcc/ChangeLog: * range-op-mixed.h: Add

[gcc r15-157] Implement operator_bitwise_or for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:6b9e640d49138183aaeee67f2dcf3de329318d27 commit r15-157-g6b9e640d49138183aaeee67f2dcf3de329318d27 Author: Aldy Hernandez Date: Wed Mar 20 10:29:50 2024 +0100 Implement operator_bitwise_or for prange. We seem to have a range-op entry for pointer bitwise

[gcc r15-156] Implement operator_bitwise_and for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:e58f14916954411628eb122da996383b8c996b57 commit r15-156-ge58f14916954411628eb122da996383b8c996b57 Author: Aldy Hernandez Date: Wed Mar 20 10:23:31 2024 +0100 Implement operator_bitwise_and for prange. gcc/ChangeLog: * range-op-mixed.h: Add

[gcc r15-155] Implement operator_pointer_diff for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:f803b93feef60c8c2d4f7f7270bfc94650dbc8f5 commit r15-155-gf803b93feef60c8c2d4f7f7270bfc94650dbc8f5 Author: Aldy Hernandez Date: Wed Mar 20 10:12:47 2024 +0100 Implement operator_pointer_diff for prange. gcc/ChangeLog: * range-op-ptr.cc

[gcc r15-154] Implement pointer_plus_operator for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:86ff3c45ea82452888244476f26a4f628b148ace commit r15-154-g86ff3c45ea82452888244476f26a4f628b148ace Author: Aldy Hernandez Date: Wed Mar 20 10:04:41 2024 +0100 Implement pointer_plus_operator for prange. gcc/ChangeLog: * range-op-ptr.cc (class

[gcc r15-153] Implement operator_addr_expr for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:54d3fd6d9f5d029c23ab376df2f5decb4902907d commit r15-153-g54d3fd6d9f5d029c23ab376df2f5decb4902907d Author: Aldy Hernandez Date: Wed Mar 20 09:51:33 2024 +0100 Implement operator_addr_expr for prange. gcc/ChangeLog: * range-op-mixed.h: Add

[gcc r15-152] Implement operator_min and operator_max for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:1a4f5d499109d3f2a06bfd1403b6d47d6f55e481 commit r15-152-g1a4f5d499109d3f2a06bfd1403b6d47d6f55e481 Author: Aldy Hernandez Date: Wed Mar 20 08:44:49 2024 +0100 Implement operator_min and operator_max for prange. gcc/ChangeLog: * range-op

[gcc r15-151] Implement operator_cast for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:95fce0dc73002d5c9557fa7260c7ba1e761136ff commit r15-151-g95fce0dc73002d5c9557fa7260c7ba1e761136ff Author: Aldy Hernandez Date: Wed Mar 20 08:04:32 2024 +0100 Implement operator_cast for prange. gcc/ChangeLog: * range-op-mixed.h: Add

[gcc r15-150] Implement operator_cst for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:a91fd7b4342dbeaf1d2514beaee3af0bb5680b81 commit r15-150-ga91fd7b4342dbeaf1d2514beaee3af0bb5680b81 Author: Aldy Hernandez Date: Wed Mar 20 07:55:57 2024 +0100 Implement operator_cst for prange. gcc/ChangeLog: * range-op-mixed.h: Add

[gcc r15-149] Implement operator_identity for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:e7b6e9663e9b31e681fb0302338bcb4bb306a334 commit r15-149-ge7b6e9663e9b31e681fb0302338bcb4bb306a334 Author: Aldy Hernandez Date: Wed Mar 20 07:50:11 2024 +0100 Implement operator_identity for prange. gcc/ChangeLog: * range-op-mixed.h: Add

[gcc r15-147] Add prange implementation for get_legacy_range.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:ddf039adef5e2695f1cb27e0b6e5056fef4be2ee commit r15-147-gddf039adef5e2695f1cb27e0b6e5056fef4be2ee Author: Aldy Hernandez Date: Wed Mar 20 06:39:48 2024 +0100 Add prange implementation for get_legacy_range. gcc/ChangeLog: * value-range.cc

[gcc r15-148] Implement range-op dispatch for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:31377eed515506c9e8ba2ac8fa3ab4e743f8c1f3 commit r15-148-g31377eed515506c9e8ba2ac8fa3ab4e743f8c1f3 Author: Aldy Hernandez Date: Wed Mar 20 07:19:45 2024 +0100 Implement range-op dispatch for prange. This patch adds the range-op dispatch code for prange

[gcc r15-146] Add hashing support for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:7c1b136630790eb34d57c45d9a816b32fd904e3f commit r15-146-g7c1b136630790eb34d57c45d9a816b32fd904e3f Author: Aldy Hernandez Date: Wed Mar 20 06:39:07 2024 +0100 Add hashing support for prange. gcc/ChangeLog: * value-range.cc (add_vrange): Add

[gcc r15-145] Add storage support for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:f859996a976ca185f371a8ed395e9c8e459e05b0 commit r15-145-gf859996a976ca185f371a8ed395e9c8e459e05b0 Author: Aldy Hernandez Date: Wed Mar 20 06:38:06 2024 +0100 Add storage support for prange. gcc/ChangeLog: * value-range-storage.cc

[gcc r15-144] Add streaming support for prange.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:a7f1285380029d2928d61e61032c1948ccabc495 commit r15-144-ga7f1285380029d2928d61e61032c1948ccabc495 Author: Aldy Hernandez Date: Wed Mar 20 06:34:26 2024 +0100 Add streaming support for prange. gcc/ChangeLog: * data-streamer-in.cc

[gcc r15-143] Implement basic prange class.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:64993a89ad75814ab69addade1b2c0020a180f41 commit r15-143-g64993a89ad75814ab69addade1b2c0020a180f41 Author: Aldy Hernandez Date: Wed Mar 20 06:25:52 2024 +0100 Implement basic prange class. This provides a bare prange class with bounds and bitmasks

[gcc r15-142] Minimal prange class showing inlining degradation to VRP.

2024-05-04 Thread Aldy Hernandez via Gcc-cvs
https://gcc.gnu.org/g:f5891967947562060076956bd953e5df4c7289bf commit r15-142-gf5891967947562060076956bd953e5df4c7289bf Author: Aldy Hernandez Date: Sat May 4 06:45:18 2024 +0200 Minimal prange class showing inlining degradation to VRP. There is a 2% slowdown to VRP unrelated

Re: [PATCH] [ranger] Force buffer alignment in Value_Range [PR114912]

2024-05-03 Thread Aldy Hernandez
: > > On Fri, May 3, 2024 at 2:24 AM Aldy Hernandez wrote: > > > > Sparc requires strict alignment and is choking on the byte vector in > > Value_Range. Is this the right approach, or is there a more canonical > > way of forcing alignment? > > I think the suggestio

[PATCH] [ranger] Force buffer alignment in Value_Range [PR114912]

2024-05-03 Thread Aldy Hernandez
Sparc requires strict alignment and is choking on the byte vector in Value_Range. Is this the right approach, or is there a more canonical way of forcing alignment? If this is correct, OK for trunk? gcc/ChangeLog: * value-range.h (class Value_Range): Use a union. --- gcc/value-range.h

  1   2   3   4   5   6   7   8   9   10   >