This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Trun predicates into a class


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]