public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: GCC patches <gcc-patches@gcc.gnu.org>
Cc: Andrew MacLeod <amacleod@redhat.com>, Martin Jambor <mjambor@suse.cz>
Subject: Re: [PATCH] Read global value/mask in IPA.
Date: Mon, 31 Jul 2023 16:40:23 +0200	[thread overview]
Message-ID: <CAGm3qMVPFVBjUr6ORE1i3BE9paLtD1o1M1jqv41pVzzB5MRD9A@mail.gmail.com> (raw)
In-Reply-To: <CAGm3qMXhbbYuhwt88ciy0pVAutj12w8xUNqtyNF7Zg3GnUzZww@mail.gmail.com>

PING * 2

On Tue, Jul 25, 2023 at 8:32 AM Aldy Hernandez <aldyh@redhat.com> wrote:
>
> Ping
>
> On Mon, Jul 17, 2023, 15:14 Aldy Hernandez <aldyh@redhat.com> wrote:
>>
>> Instead of reading the known zero bits in IPA, read the value/mask
>> pair which is available.
>>
>> There is a slight change of behavior here.  I have removed the check
>> for SSA_NAME, as the ranger can calculate the range and value/mask for
>> INTEGER_CST.  This simplifies the code a bit, since there's no special
>> casing when setting the jfunc bits.  The default range for VR is
>> undefined, so I think it's safe just to check for undefined_p().
>>
>> OK?
>>
>> gcc/ChangeLog:
>>
>>         * ipa-prop.cc (ipa_compute_jump_functions_for_edge): Read global
>>         value/mask.
>> ---
>>  gcc/ipa-prop.cc | 18 ++++++++----------
>>  1 file changed, 8 insertions(+), 10 deletions(-)
>>
>> diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
>> index 5d790ff1265..4f6ed7b89bd 100644
>> --- a/gcc/ipa-prop.cc
>> +++ b/gcc/ipa-prop.cc
>> @@ -2402,8 +2402,7 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi,
>>         }
>>        else
>>         {
>> -         if (TREE_CODE (arg) == SSA_NAME
>> -             && param_type
>> +         if (param_type
>>               && Value_Range::supports_type_p (TREE_TYPE (arg))
>>               && Value_Range::supports_type_p (param_type)
>>               && irange::supports_p (TREE_TYPE (arg))
>> @@ -2422,15 +2421,14 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi,
>>             gcc_assert (!jfunc->m_vr);
>>         }
>>
>> -      if (INTEGRAL_TYPE_P (TREE_TYPE (arg))
>> -         && (TREE_CODE (arg) == SSA_NAME || TREE_CODE (arg) == INTEGER_CST))
>> +      if (INTEGRAL_TYPE_P (TREE_TYPE (arg)) && !vr.undefined_p ())
>>         {
>> -         if (TREE_CODE (arg) == SSA_NAME)
>> -           ipa_set_jfunc_bits (jfunc, 0,
>> -                               widest_int::from (get_nonzero_bits (arg),
>> -                                                 TYPE_SIGN (TREE_TYPE (arg))));
>> -         else
>> -           ipa_set_jfunc_bits (jfunc, wi::to_widest (arg), 0);
>> +         irange &r = as_a <irange> (vr);
>> +         irange_bitmask bm = r.get_bitmask ();
>> +         signop sign = TYPE_SIGN (TREE_TYPE (arg));
>> +         ipa_set_jfunc_bits (jfunc,
>> +                             widest_int::from (bm.value (), sign),
>> +                             widest_int::from (bm.mask (), sign));
>>         }
>>        else if (POINTER_TYPE_P (TREE_TYPE (arg)))
>>         {
>> --
>> 2.40.1
>>


      reply	other threads:[~2023-07-31 14:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 13:14 Aldy Hernandez
2023-07-18 17:37 ` Aldy Hernandez
2023-07-31 16:47   ` Martin Jambor
2023-08-03 18:21     ` Aldy Hernandez
2023-07-25  6:32 ` Aldy Hernandez
2023-07-31 14:40   ` Aldy Hernandez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGm3qMVPFVBjUr6ORE1i3BE9paLtD1o1M1jqv41pVzzB5MRD9A@mail.gmail.com \
    --to=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mjambor@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).