public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Jambor <mjambor@suse.cz>
To: Feng Xue OS <fxue@os.amperecomputing.com>,
	"gcc-patches\@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PATCH] Generalized predicate/condition for parameter reference in IPA (PR ipa/91088)
Date: Fri, 30 Aug 2019 09:00:00 -0000	[thread overview]
Message-ID: <ri68srbavtb.fsf@suse.cz> (raw)
In-Reply-To: <BYAPR01MB486970FD13D12C4A21B9F1D2F7BD0@BYAPR01MB4869.prod.exchangelabs.com>

Hi,

On Fri, Aug 30 2019, Feng Xue OS wrote:
>> (It's a bad idea to make ChangeLog entries part of the patch, it won't
>> apply to anyone, not even to you nowadays. )
> Got it. Will not include this kind of info in later patches.
>
>> I understand describing these things is difficult, but flatten is
>> strange way to describe what the function does.  What about somthing
>> like the following?
>> 
>> Analyze EXPR if it represents a series of simple operations performed on
>> a function parameter and return true if so.  FBI, STMT, INDEX_P, SIZE_P
>> and AGGPOS have the same meaning like in
>> unmodified_parm_or_parm_agg_item.  Operations on the parameter are
>> recorded to PARAM_OPS_P if it is not NULL.
> Operations should be recorded in some place, and this is why PARAM_OPS_P
> is used. Not quite understand this point.

I was merely suggesting a better comment describing the function you are
introducing.

>
>>> +           /* Find use of parameter, add a convert operation to describe
>>> +              result type, which may not be same as parameter type.  */
>>> +           eval_op.val_is_rhs = false;
>>> +           eval_op.val = NULL_TREE;
>>> +           eval_op.code = VIEW_CONVERT_EXPR;
>>> +           eval_op.type = TREE_TYPE (expr);
>>> +
>>> +           vec_safe_insert (*param_ops_p, 0, eval_op);
>
>> If we get here in the first iteration of the loop, could we not insert
>> anything into the vector and handle such cases in
>> evaluate_conditions_for_known_args like we do today (well, with
>> fold_convert might be better)?  It could save quite some memory and it
>> is important to try keep the memory footprint down in IPA summaries.
> Here is a little trick to make code of folding in evaluate_conditions_for_known_args ()
> be simple. It does consume some memory for most cases. Will consider other way
> and remove this.

Thinking about it a bit more, I think you simply do not want to ever
push the extra VIEW_CONVERT_EXPR to the vector and in
evaluate_conditions_for_known_args always do a fold_convert to the
desired type (similarly like we do today).

Thanks,

Martin

>
>> Also, I think you want a parameter to limit the maximum length of
>> param_ops_p, at some point someone will come with some crazy
>> machine-generated code that will create huge vectors.
> Yes. Exactly.
>
> Thanks,
>
> Martin

  reply	other threads:[~2019-08-30  8:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12 11:34 Feng Xue OS
2019-08-29 17:02 ` Martin Jambor
2019-08-30  8:42   ` Feng Xue OS
2019-08-30  9:00     ` Martin Jambor [this message]
2019-08-30  9:02       ` Feng Xue OS
2019-09-04 10:08   ` [PATCH V2] " Feng Xue OS
2019-09-04 10:20     ` [PATCH V3] " Feng Xue OS
2019-09-14 17:18       ` Jan Hubicka
2019-09-18 12:41         ` [PATCH V4] " Feng Xue OS
2019-09-30  8:51           ` Ping: " Feng Xue OS
2019-10-15 17:04           ` Jan Hubicka

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=ri68srbavtb.fsf@suse.cz \
    --to=mjambor@suse.cz \
    --cc=fxue@os.amperecomputing.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.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).