Commit 991278ab by Jan Hubicka

inline-9.c: New testcase.

	* testsuite/gcc.dg/tree-ssa/inline-9.c: New testcase.
	* ipa-inline.h (struct inline_edge_summary): Add predicate pointer.
	* ipa-inline-analysis.c: Include alloc-pool.h.
	(edge_predicate_pool): New.
	(trye_predicate_p): New function
	(false_predicate_p): New function.
	(add_clause): Sanity check that false clauses are "optimized";
	never add clauses to predicate that is already known to be false.
	(and_predicate): Use flase_predicate_p.
	(evaulate_predicate): Rename to ...
	(evaluate_predicate): ... this one; update all callers; assert
	that false is not listed among possible truths.
	(dump_predicate): Use true_predicate_p.
	(account_size_time): Use false_predicate_p.
	(evaulate_conditions_for_edge): Rename to ...
	(evaluate_conditions_for_edge) ... this one.
	(edge_set_predicate): New function.
	(inline_edge_duplication_hook): Duplicate edge predicates.
	(inline_edge_removal_hook): Free edge predicates.
	(dump_inline_edge_summary): Add INFO parameter; dump
	edge predicates.
	(dump_inline_summary): Update.
	(estimate_function_body_sizes): Set edge predicates.
	(estimate_calls_size_and_time): Handle predicates.
	(estimate_callee_size_and_time): Update.
	(remap_predicate): Add toplev_predicate; update comment.
	(remap_edge_predicates): New function.
	(inline_merge_summary): Compute toplev predicate; update.
	(read_predicate): New function.
	(read_inline_edge_summary): Use it.
	(inline_read_section): Likewise.
	(write_predicate): New function.
	(write_inline_edge_summary): Use it.
	(inline_write_summary): Likewise.
	(inline_free_summary): Free alloc pool and edge summary vec.

From-SVN: r173042
parent 648b5f85
2011-04-27 Jan Hubcika <jh@suse.cz>
* ipa-inline.h (struct inline_edge_summary): Add predicate pointer.
* ipa-inline-analysis.c: Include alloc-pool.h.
(edge_predicate_pool): New.
(trye_predicate_p): New function
(false_predicate_p): New function.
(add_clause): Sanity check that false clauses are "optimized";
never add clauses to predicate that is already known to be false.
(and_predicate): Use flase_predicate_p.
(evaulate_predicate): Rename to ...
(evaluate_predicate): ... this one; update all callers; assert
that false is not listed among possible truths.
(dump_predicate): Use true_predicate_p.
(account_size_time): Use false_predicate_p.
(evaulate_conditions_for_edge): Rename to ...
(evaluate_conditions_for_edge) ... this one.
(edge_set_predicate): New function.
(inline_edge_duplication_hook): Duplicate edge predicates.
(inline_edge_removal_hook): Free edge predicates.
(dump_inline_edge_summary): Add INFO parameter; dump
edge predicates.
(dump_inline_summary): Update.
(estimate_function_body_sizes): Set edge predicates.
(estimate_calls_size_and_time): Handle predicates.
(estimate_callee_size_and_time): Update.
(remap_predicate): Add toplev_predicate; update comment.
(remap_edge_predicates): New function.
(inline_merge_summary): Compute toplev predicate; update.
(read_predicate): New function.
(read_inline_edge_summary): Use it.
(inline_read_section): Likewise.
(write_predicate): New function.
(write_inline_edge_summary): Use it.
(inline_write_summary): Likewise.
(inline_free_summary): Free alloc pool and edge summary vec.
2011-04-27 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (changed_count): Remove.
......
......@@ -120,6 +120,7 @@ struct inline_edge_summary
int call_stmt_time;
/* Depth of loop nest, 0 means no nesting. */
unsigned short int loop_depth;
struct predicate *predicate;
};
typedef struct inline_edge_summary inline_edge_summary_t;
......
2011-04-27 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-ssa/inline-9.c: New testcase.
2011-04-27 Jason Merrill <jason@redhat.com>
* g++.old-deja/g++.oliva/overload1.C: Adjust.
......
/* { dg-do compile } */
/* { dg-options "-Os -fdump-tree-optimized" } */
/* When optimizing for size, t should be inlined when it expands to one call only. */
extern int q(int);
int t(int a)
{
if (a > 12)
{
q(a+5);
q(a+5);
}
else
q(a+10);
}
main()
{
t(5);
t(20);
}
/* { dg-final { scan-tree-dump-times "q \\(15\\)" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "t \\(20\\)" 1 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment