* [PATCH] Change set_value_range_to_[non]null to not preserve equivs
@ 2018-11-12 11:11 Richard Biener
2018-11-12 13:57 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2018-11-12 11:11 UTC (permalink / raw)
To: gcc-patches
This is a semantic change but AFAICS it shouldn't result in any
pessimization. The behavior of the API is non-obvious.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2018-11-12 Richard Biener <rguenther@suse.de>
* tree-vrp.c (set_value_range_to_nonnull): Clear equiv.
(set_value_range_to_null): Likewise.
* vr-values.c (vr_values::extract_range_from_comparison):
Clear equiv for constant singleton ranges.
Index: gcc/tree-vrp.c
===================================================================
--- gcc/tree-vrp.c (revision 266026)
+++ gcc/tree-vrp.c (working copy)
@@ -767,7 +767,7 @@ void
set_value_range_to_nonnull (value_range *vr, tree type)
{
tree zero = build_int_cst (type, 0);
- vr->update (VR_ANTI_RANGE, zero, zero);
+ set_value_range (vr, VR_ANTI_RANGE, zero, zero, NULL);
}
@@ -776,7 +776,7 @@ set_value_range_to_nonnull (value_range
void
set_value_range_to_null (value_range *vr, tree type)
{
- set_value_range_to_value (vr, build_int_cst (type, 0), vr->equiv ());
+ set_value_range_to_value (vr, build_int_cst (type, 0), NULL);
}
/* Return true, if VAL1 and VAL2 are equal values for VRP purposes. */
Index: gcc/vr-values.c
===================================================================
--- gcc/vr-values.c (revision 266026)
+++ gcc/vr-values.c (working copy)
@@ -896,7 +896,7 @@ vr_values::extract_range_from_comparison
type. */
val = fold_convert (type, val);
if (is_gimple_min_invariant (val))
- set_value_range_to_value (vr, val, vr->equiv ());
+ set_value_range_to_value (vr, val, NULL);
else
vr->update (VR_RANGE, val, val);
}
@@ -1672,7 +1672,7 @@ vr_values::adjust_range_with_scev (value
/* Like in PR19590, scev can return a constant function. */
if (is_gimple_min_invariant (chrec))
{
- set_value_range_to_value (vr, chrec, vr->equiv ());
+ set_value_range_to_value (vr, chrec, NULL);
return;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Change set_value_range_to_[non]null to not preserve equivs
2018-11-12 11:11 [PATCH] Change set_value_range_to_[non]null to not preserve equivs Richard Biener
@ 2018-11-12 13:57 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2018-11-12 13:57 UTC (permalink / raw)
To: Richard Biener, gcc-patches
On 11/12/18 4:11 AM, Richard Biener wrote:
>
> This is a semantic change but AFAICS it shouldn't result in any
> pessimization. The behavior of the API is non-obvious.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
>
> Richard.
>
> 2018-11-12 Richard Biener <rguenther@suse.de>
>
> * tree-vrp.c (set_value_range_to_nonnull): Clear equiv.
> (set_value_range_to_null): Likewise.
> * vr-values.c (vr_values::extract_range_from_comparison):
> Clear equiv for constant singleton ranges.
No concerns from my side. When I did my work last year I was trying to
preserve existing semantics, so I didn't really look at places to drop
uses of the equivalence bitmaps.
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-12 13:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12 11:11 [PATCH] Change set_value_range_to_[non]null to not preserve equivs Richard Biener
2018-11-12 13:57 ` Jeff Law
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).