This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Trun predicates into a class
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 17 May 2017 09:46:01 -0400
- Subject: Re: Trun predicates into a class
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dmalcolm at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C2DD3C05681A
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C2DD3C05681A
- References: <20170517104807.GA93683@kam.mff.cuni.cz>
On Wed, 2017-05-17 at 12:48 +0200, Jan Hubicka wrote:
> Hi,
> this is first patch of series to modularize function analysis done by
> ipa-inline and ipa-cp. This patch turns predicates into a class. It
> avoids any
> code movement or semnatic changes which I will do next. Main change
> is to
> turn some of functions into operators which makes the code more
> compact and
> hopefully also more readable.
>
> I plan to move them into separate ipa-predicates.c and then breakup
> rest of
> ipa-inline-analysis into part that is independent of inliner (into
> new
> fnsummary pass doing also some work of ipa-prop) and inliner specific
> analysis.
>
> Bootstrapped/regtested x86_64-linux. I have checked that there is no
> effect
> on code or inline estimates for tramp3d. Will commit it after bit of
> further testing.
>
> Honza
[snip]
> * ipa-inline.h (MAX_CLAUSES): Turn to predicate::max_clauses.
> (clause_t): Turn to uint32_t
> (predicate): Turn to class; implement constructor and operators
> ==, !=, &
> (size_time_entry): Update.
> (inline_summary): Update.
> (inline_edge_summary): Update.
>
[snip]
> Index: ipa-inline.h
> ===================================================================
> --- ipa-inline.h (revision 248142)
> +++ ipa-inline.h (working copy)
[snip]
> -/* Representation of predicates i.e. formulas using conditions
> defined
> - above. Predicates are simple logical formulas in conjunctive
> -disjunctive
> - form.
> -
> - Predicate is array of clauses terminated by 0. Every clause must
> be true
> - in order to make predicate true.
> - Clauses are represented as bitmaps of conditions. One of
> conditions
> - must be true in order for clause to be true. */
> -
> -#define MAX_CLAUSES 8
> -typedef unsigned int clause_t;
> -struct GTY(()) predicate
>
[snip]
> +class predicate
> {
I noticed that the patch removes the "GTY(())" from "predicate".
Was that deliberate? (I've no idea if it was needed before; I just
thought it was worth mentioning, since gengtype issues can be a pain to
track down).
Dave