* [PATCH] Export value/mask known bits from CCP.
@ 2023-07-17 7:56 Aldy Hernandez
2023-07-17 11:52 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Aldy Hernandez @ 2023-07-17 7:56 UTC (permalink / raw)
To: GCC patches; +Cc: Andrew MacLeod, Aldy Hernandez
Currently CCP throws away the known 1 bits because VRP and irange have
traditionally only had a way of tracking known 0s (set_nonzero_bits).
With the ability to keep all the known bits in the irange, we can now
save this between passes.
OK?
gcc/ChangeLog:
* tree-ssa-ccp.cc (ccp_finalize): Export value/mask known bits.
---
gcc/tree-ssa-ccp.cc | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/gcc/tree-ssa-ccp.cc b/gcc/tree-ssa-ccp.cc
index 0d0f02a8442..64d5fa81334 100644
--- a/gcc/tree-ssa-ccp.cc
+++ b/gcc/tree-ssa-ccp.cc
@@ -1020,11 +1020,9 @@ ccp_finalize (bool nonzero_p)
else
{
unsigned int precision = TYPE_PRECISION (TREE_TYPE (val->value));
- wide_int nonzero_bits
- = (wide_int::from (val->mask, precision, UNSIGNED)
- | wi::to_wide (val->value));
- nonzero_bits &= get_nonzero_bits (name);
- set_nonzero_bits (name, nonzero_bits);
+ wide_int value = wi::to_wide (val->value);
+ wide_int mask = wide_int::from (val->mask, precision, UNSIGNED);
+ set_bitmask (name, value, mask);
}
}
--
2.40.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Export value/mask known bits from CCP.
2023-07-17 7:56 [PATCH] Export value/mask known bits from CCP Aldy Hernandez
@ 2023-07-17 11:52 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2023-07-17 11:52 UTC (permalink / raw)
To: Aldy Hernandez; +Cc: GCC patches, Andrew MacLeod
On Mon, Jul 17, 2023 at 9:57 AM Aldy Hernandez via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Currently CCP throws away the known 1 bits because VRP and irange have
> traditionally only had a way of tracking known 0s (set_nonzero_bits).
> With the ability to keep all the known bits in the irange, we can now
> save this between passes.
>
> OK?
OK.
> gcc/ChangeLog:
>
> * tree-ssa-ccp.cc (ccp_finalize): Export value/mask known bits.
> ---
> gcc/tree-ssa-ccp.cc | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/gcc/tree-ssa-ccp.cc b/gcc/tree-ssa-ccp.cc
> index 0d0f02a8442..64d5fa81334 100644
> --- a/gcc/tree-ssa-ccp.cc
> +++ b/gcc/tree-ssa-ccp.cc
> @@ -1020,11 +1020,9 @@ ccp_finalize (bool nonzero_p)
> else
> {
> unsigned int precision = TYPE_PRECISION (TREE_TYPE (val->value));
> - wide_int nonzero_bits
> - = (wide_int::from (val->mask, precision, UNSIGNED)
> - | wi::to_wide (val->value));
> - nonzero_bits &= get_nonzero_bits (name);
> - set_nonzero_bits (name, nonzero_bits);
> + wide_int value = wi::to_wide (val->value);
> + wide_int mask = wide_int::from (val->mask, precision, UNSIGNED);
> + set_bitmask (name, value, mask);
> }
> }
>
> --
> 2.40.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-17 11:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-17 7:56 [PATCH] Export value/mask known bits from CCP Aldy Hernandez
2023-07-17 11:52 ` 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).