Commit b15c64ee by Jan Hubicka Committed by Jan Hubicka

inline-10.c: New testcase.

	* gcc.dg/tree-ssa/inline-10.c: New testcase.
	* gcc.dg/tree-ssa/inline-9.c: Disable partial inlining.
	* ipa-inline.h (clause_t): Turn into unsigned int.
	* ipa-inline-analysis.c (add_clause): Do more simplification.
	(and_predicates): Shortcut more cases.
	(predicates_equal_p): Move forward; check that clauses are properly
	ordered.
	(or_predicates): Shortcut more cases.
	(edge_execution_predicate): Rewrite as...
	(set_cond_stmt_execution_predicate): ... this function; handle
	__builtin_constant_p.
	(set_switch_stmt_execution_predicate): New .
	(compute_bb_predicates): New.
	(will_be_nonconstant_predicate): Update TODO.
	(estimate_function_body_sizes): Use compute_bb_predicates
	and free them later, always try to estimate if stmt is constant.
	(estimate_time_after_inlining, estimate_size_after_inlining):
	Gracefully handle optimized out edges.
	(read_predicate): Fix off by one error.

From-SVN: r173190
parent 7097b041
2011-04-29 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-ssa/inline-10.c: New testcase.
* gcc.dg/tree-ssa/inline-9.c: Disable partial inlining.
* ipa-inline.h (clause_t): Turn into unsigned int.
* ipa-inline-analysis.c (add_clause): Do more simplification.
(and_predicates): Shortcut more cases.
(predicates_equal_p): Move forward; check that clauses are properly
ordered.
(or_predicates): Shortcut more cases.
(edge_execution_predicate): Rewrite as...
(set_cond_stmt_execution_predicate): ... this function; handle
__builtin_constant_p.
(set_switch_stmt_execution_predicate): New .
(compute_bb_predicates): New.
(will_be_nonconstant_predicate): Update TODO.
(estimate_function_body_sizes): Use compute_bb_predicates
and free them later, always try to estimate if stmt is constant.
(estimate_time_after_inlining, estimate_size_after_inlining):
Gracefully handle optimized out edges.
(read_predicate): Fix off by one error.
2011-04-29 Nicola Pero <nicola.pero@meta-innovation.com>
* Makefile.in (ENABLE_MAINTAINER_RULES): New.
......
......@@ -48,7 +48,7 @@ typedef VEC(condition,gc) *conditions;
must be true in order for clause to be true. */
#define MAX_CLAUSES 8
typedef int clause_t;
typedef unsigned int clause_t;
struct GTY(()) predicate
{
clause_t clause[MAX_CLAUSES + 1];
......
/* { dg-do compile } */
/* { dg-options "-Os -fdump-tree-optimized -fno-partial-inlining" } */
void do_something1(void);
void do_something2(void);
void do_something3(void);
void do_something4(void);
void do_something5(void);
void do_something_big(int);
int do_something (int size)
{
if (__builtin_constant_p (size))
switch (size)
{
case 1:do_something1 (); break;
case 2:do_something2 (); break;
case 5:do_something1 (); do_something1 ();
case 3:do_something3 (); break;
case 4:do_something4 (); break;
}
else
do_something_big (size);
}
extern int n;
main()
{
do_something (2);
do_something (3);
do_something (5);
do_something (70);
}
/* All calls should be inlined, except for do_something (5). */
/* { dg-final { scan-tree-dump-not "do_something1" "optimized" } } */
/* { dg-final { scan-tree-dump-times "do_something2" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "do_something3" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "do_something \\(5\\)" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-not "do_something \\(70\\)" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
/* { dg-do compile } */
/* { dg-options "-Os -fdump-tree-optimized" } */
/* { dg-options "-Os -fdump-tree-optimized -fno-partial-inlining" } */
/* When optimizing for size, t should be inlined when it expands to one call only. */
extern int q(int);
......
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