Commit 45852dcc by Andrew MacLeod Committed by Andrew Macleod

gimplify.h (gimplify_hasher : typed_free_remove, [...]): Move to gimplify.c.



	* gimplify.h (gimplify_hasher : typed_free_remove, struct gimplify_ctx):
	Move to gimplify.c.
	(free_gimplify_stack): Add prototype.
	* gimplify.c (gimplify_hasher:typed_free_remove): Relocate here.
	(struct gimplify_ctx): Relocate here.
	(gimplify_ctxp): Make static.
	(ctx_pool, ctx_alloc, ctx_free, free_gimplify_stack): New.  Manage a 
	list of struct gimplify_ctx.
	(push_gimplify_context): Add default parameters and allocate a struct
	from the pool.
	(pop_gimplify_context): Free a struct back to the pool.
	(gimplify_scan_omp_clauses, gimplify_omp_parallel, gimplify_omp_task,
	gimplify_omp_workshare, gimplify_transaction, gimplify_body): Don't
	use a local 'struct gimplify_ctx'.
	* cgraphunit.c (expand_all_functions): call free_gimplify_stack.
	* gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands):
	Likewise.
	* omp-low.c (lower_omp_sections, lower_omp_single, lower_omp_master,
	lower_omp_ordered, lower_omp_critical, lower_omp_for,
	create_task_copyfn, lower_omp_taskreg, lower_omp_target,
	lower_omp_teams, execute_lower_omp): Likewise.
	* gimple-fold.c (gimplify_and_update_call_from_tree): Likewise.
	* tree-inline.c (optimize_inline_calls): Likewise.

From-SVN: r205168
parent 41fd6659
2013-11-20 Andrew MacLeod <amacleod@redhat.com>
* gimplify.h (gimplify_hasher : typed_free_remove, struct gimplify_ctx):
Move to gimplify.c.
(free_gimplify_stack): Add prototype.
* gimplify.c (gimplify_hasher:typed_free_remove): Relocate here.
(struct gimplify_ctx): Relocate here.
(gimplify_ctxp): Make static.
(ctx_pool, ctx_alloc, ctx_free, free_gimplify_stack): New. Manage a
list of struct gimplify_ctx.
(push_gimplify_context): Add default parameters and allocate a struct
from the pool.
(pop_gimplify_context): Free a struct back to the pool.
(gimplify_scan_omp_clauses, gimplify_omp_parallel, gimplify_omp_task,
gimplify_omp_workshare, gimplify_transaction, gimplify_body): Don't
use a local 'struct gimplify_ctx'.
* cgraphunit.c (expand_all_functions): call free_gimplify_stack.
* gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands):
Likewise.
* omp-low.c (lower_omp_sections, lower_omp_single, lower_omp_master,
lower_omp_ordered, lower_omp_critical, lower_omp_for,
create_task_copyfn, lower_omp_taskreg, lower_omp_target,
lower_omp_teams, execute_lower_omp): Likewise.
* gimple-fold.c (gimplify_and_update_call_from_tree): Likewise.
* tree-inline.c (optimize_inline_calls): Likewise.
2013-11-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com> 2013-11-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/vsx.md (vsx_set_<mode>): Adjust for little endian. * config/rs6000/vsx.md (vsx_set_<mode>): Adjust for little endian.
...@@ -205,6 +205,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -205,6 +205,7 @@ along with GCC; see the file COPYING3. If not see
#include "context.h" #include "context.h"
#include "pass_manager.h" #include "pass_manager.h"
#include "tree-nested.h" #include "tree-nested.h"
#include "gimplify.h"
/* Queue of cgraph nodes scheduled to be added into cgraph. This is a /* Queue of cgraph nodes scheduled to be added into cgraph. This is a
secondary queue used during optimization to accommodate passes that secondary queue used during optimization to accommodate passes that
...@@ -1866,6 +1867,7 @@ expand_all_functions (void) ...@@ -1866,6 +1867,7 @@ expand_all_functions (void)
} }
} }
cgraph_process_new_functions (); cgraph_process_new_functions ();
free_gimplify_stack ();
free (order); free (order);
......
...@@ -608,7 +608,6 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr) ...@@ -608,7 +608,6 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
gimple stmt, new_stmt; gimple stmt, new_stmt;
gimple_stmt_iterator i; gimple_stmt_iterator i;
gimple_seq stmts = NULL; gimple_seq stmts = NULL;
struct gimplify_ctx gctx;
gimple laststore; gimple laststore;
tree reaching_vuse; tree reaching_vuse;
...@@ -616,8 +615,7 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr) ...@@ -616,8 +615,7 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
gcc_assert (is_gimple_call (stmt)); gcc_assert (is_gimple_call (stmt));
push_gimplify_context (&gctx); push_gimplify_context (gimple_in_ssa_p (cfun));
gctx.into_ssa = gimple_in_ssa_p (cfun);
lhs = gimple_call_lhs (stmt); lhs = gimple_call_lhs (stmt);
if (lhs == NULL_TREE) if (lhs == NULL_TREE)
......
...@@ -45,7 +45,6 @@ force_gimple_operand_1 (tree expr, gimple_seq *stmts, ...@@ -45,7 +45,6 @@ force_gimple_operand_1 (tree expr, gimple_seq *stmts,
gimple_predicate gimple_test_f, tree var) gimple_predicate gimple_test_f, tree var)
{ {
enum gimplify_status ret; enum gimplify_status ret;
struct gimplify_ctx gctx;
location_t saved_location; location_t saved_location;
*stmts = NULL; *stmts = NULL;
...@@ -57,16 +56,13 @@ force_gimple_operand_1 (tree expr, gimple_seq *stmts, ...@@ -57,16 +56,13 @@ force_gimple_operand_1 (tree expr, gimple_seq *stmts,
&& (*gimple_test_f) (expr)) && (*gimple_test_f) (expr))
return expr; return expr;
push_gimplify_context (&gctx); push_gimplify_context (gimple_in_ssa_p (cfun), true);
gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun);
gimplify_ctxp->allow_rhs_cond_expr = true;
saved_location = input_location; saved_location = input_location;
input_location = UNKNOWN_LOCATION; input_location = UNKNOWN_LOCATION;
if (var) if (var)
{ {
if (gimplify_ctxp->into_ssa if (gimple_in_ssa_p (cfun) && is_gimple_reg (var))
&& is_gimple_reg (var))
var = make_ssa_name (var, NULL); var = make_ssa_name (var, NULL);
expr = build2 (MODIFY_EXPR, TREE_TYPE (var), var, expr); expr = build2 (MODIFY_EXPR, TREE_TYPE (var), var, expr);
} }
...@@ -160,10 +156,8 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p) ...@@ -160,10 +156,8 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
tree lhs; tree lhs;
gimple_seq pre = NULL; gimple_seq pre = NULL;
gimple post_stmt = NULL; gimple post_stmt = NULL;
struct gimplify_ctx gctx;
push_gimplify_context (&gctx); push_gimplify_context (gimple_in_ssa_p (cfun));
gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun);
switch (gimple_code (stmt)) switch (gimple_code (stmt))
{ {
......
...@@ -89,6 +89,37 @@ enum omp_region_type ...@@ -89,6 +89,37 @@ enum omp_region_type
ORT_TARGET = 32 ORT_TARGET = 32
}; };
/* Gimplify hashtable helper. */
struct gimplify_hasher : typed_free_remove <elt_t>
{
typedef elt_t value_type;
typedef elt_t compare_type;
static inline hashval_t hash (const value_type *);
static inline bool equal (const value_type *, const compare_type *);
};
struct gimplify_ctx
{
struct gimplify_ctx *prev_context;
vec<gimple> bind_expr_stack;
tree temps;
gimple_seq conditional_cleanups;
tree exit_label;
tree return_temp;
vec<tree> case_labels;
/* The formal temporary table. Should this be persistent? */
hash_table <gimplify_hasher> temp_htab;
int conditions;
bool save_stack;
bool into_ssa;
bool allow_rhs_cond_expr;
bool in_cleanup_point_expr;
};
struct gimplify_omp_ctx struct gimplify_omp_ctx
{ {
struct gimplify_omp_ctx *outer_context; struct gimplify_omp_ctx *outer_context;
...@@ -100,10 +131,9 @@ struct gimplify_omp_ctx ...@@ -100,10 +131,9 @@ struct gimplify_omp_ctx
bool combined_loop; bool combined_loop;
}; };
struct gimplify_ctx *gimplify_ctxp; static struct gimplify_ctx *gimplify_ctxp;
static struct gimplify_omp_ctx *gimplify_omp_ctxp; static struct gimplify_omp_ctx *gimplify_omp_ctxp;
/* Forward declaration. */ /* Forward declaration. */
static enum gimplify_status gimplify_compound_expr (tree *, gimple_seq *, bool); static enum gimplify_status gimplify_compound_expr (tree *, gimple_seq *, bool);
...@@ -134,14 +164,63 @@ gimplify_seq_add_seq (gimple_seq *dst_p, gimple_seq src) ...@@ -134,14 +164,63 @@ gimplify_seq_add_seq (gimple_seq *dst_p, gimple_seq src)
gsi_insert_seq_after_without_update (&si, src, GSI_NEW_STMT); gsi_insert_seq_after_without_update (&si, src, GSI_NEW_STMT);
} }
/* Pointer to a list of allocated gimplify_ctx structs to be used for pushing
and popping gimplify contexts. */
static struct gimplify_ctx *ctx_pool = NULL;
/* Return a gimplify context struct from the pool. */
static inline struct gimplify_ctx *
ctx_alloc (void)
{
struct gimplify_ctx * c = ctx_pool;
if (c)
ctx_pool = c->prev_context;
else
c = XNEW (struct gimplify_ctx);
memset (c, '\0', sizeof (*c));
return c;
}
/* Put gimplify context C back into the pool. */
static inline void
ctx_free (struct gimplify_ctx *c)
{
c->prev_context = ctx_pool;
ctx_pool = c;
}
/* Free allocated ctx stack memory. */
void
free_gimplify_stack (void)
{
struct gimplify_ctx *c;
while ((c = ctx_pool))
{
ctx_pool = c->prev_context;
free (c);
}
}
/* Set up a context for the gimplifier. */ /* Set up a context for the gimplifier. */
void void
push_gimplify_context (struct gimplify_ctx *c) push_gimplify_context (bool in_ssa, bool rhs_cond_ok)
{ {
memset (c, '\0', sizeof (*c)); struct gimplify_ctx *c = ctx_alloc ();
c->prev_context = gimplify_ctxp; c->prev_context = gimplify_ctxp;
gimplify_ctxp = c; gimplify_ctxp = c;
gimplify_ctxp->into_ssa = in_ssa;
gimplify_ctxp->allow_rhs_cond_expr = rhs_cond_ok;
} }
/* Tear down a context for the gimplifier. If BODY is non-null, then /* Tear down a context for the gimplifier. If BODY is non-null, then
...@@ -168,6 +247,7 @@ pop_gimplify_context (gimple body) ...@@ -168,6 +247,7 @@ pop_gimplify_context (gimple body)
if (c->temp_htab.is_created ()) if (c->temp_htab.is_created ())
c->temp_htab.dispose (); c->temp_htab.dispose ();
ctx_free (c);
} }
/* Push a GIMPLE_BIND tuple onto the stack of bindings. */ /* Push a GIMPLE_BIND tuple onto the stack of bindings. */
...@@ -5726,7 +5806,6 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, ...@@ -5726,7 +5806,6 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
enum omp_region_type region_type) enum omp_region_type region_type)
{ {
struct gimplify_omp_ctx *ctx, *outer_ctx; struct gimplify_omp_ctx *ctx, *outer_ctx;
struct gimplify_ctx gctx;
tree c; tree c;
ctx = new_omp_context (region_type); ctx = new_omp_context (region_type);
...@@ -5863,7 +5942,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, ...@@ -5863,7 +5942,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
omp_add_variable (ctx, OMP_CLAUSE_REDUCTION_PLACEHOLDER (c), omp_add_variable (ctx, OMP_CLAUSE_REDUCTION_PLACEHOLDER (c),
GOVD_LOCAL | GOVD_SEEN); GOVD_LOCAL | GOVD_SEEN);
gimplify_omp_ctxp = ctx; gimplify_omp_ctxp = ctx;
push_gimplify_context (&gctx); push_gimplify_context ();
OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c) = NULL; OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c) = NULL;
OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c) = NULL; OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c) = NULL;
...@@ -5872,7 +5951,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, ...@@ -5872,7 +5951,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
&OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c)); &OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c));
pop_gimplify_context pop_gimplify_context
(gimple_seq_first_stmt (OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c))); (gimple_seq_first_stmt (OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c)));
push_gimplify_context (&gctx); push_gimplify_context ();
gimplify_and_add (OMP_CLAUSE_REDUCTION_MERGE (c), gimplify_and_add (OMP_CLAUSE_REDUCTION_MERGE (c),
&OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c)); &OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c));
pop_gimplify_context pop_gimplify_context
...@@ -5886,7 +5965,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, ...@@ -5886,7 +5965,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
&& OMP_CLAUSE_LASTPRIVATE_STMT (c)) && OMP_CLAUSE_LASTPRIVATE_STMT (c))
{ {
gimplify_omp_ctxp = ctx; gimplify_omp_ctxp = ctx;
push_gimplify_context (&gctx); push_gimplify_context ();
if (TREE_CODE (OMP_CLAUSE_LASTPRIVATE_STMT (c)) != BIND_EXPR) if (TREE_CODE (OMP_CLAUSE_LASTPRIVATE_STMT (c)) != BIND_EXPR)
{ {
tree bind = build3 (BIND_EXPR, void_type_node, NULL, tree bind = build3 (BIND_EXPR, void_type_node, NULL,
...@@ -6309,14 +6388,13 @@ gimplify_omp_parallel (tree *expr_p, gimple_seq *pre_p) ...@@ -6309,14 +6388,13 @@ gimplify_omp_parallel (tree *expr_p, gimple_seq *pre_p)
tree expr = *expr_p; tree expr = *expr_p;
gimple g; gimple g;
gimple_seq body = NULL; gimple_seq body = NULL;
struct gimplify_ctx gctx;
gimplify_scan_omp_clauses (&OMP_PARALLEL_CLAUSES (expr), pre_p, gimplify_scan_omp_clauses (&OMP_PARALLEL_CLAUSES (expr), pre_p,
OMP_PARALLEL_COMBINED (expr) OMP_PARALLEL_COMBINED (expr)
? ORT_COMBINED_PARALLEL ? ORT_COMBINED_PARALLEL
: ORT_PARALLEL); : ORT_PARALLEL);
push_gimplify_context (&gctx); push_gimplify_context ();
g = gimplify_and_return_first (OMP_PARALLEL_BODY (expr), &body); g = gimplify_and_return_first (OMP_PARALLEL_BODY (expr), &body);
if (gimple_code (g) == GIMPLE_BIND) if (gimple_code (g) == GIMPLE_BIND)
...@@ -6346,14 +6424,13 @@ gimplify_omp_task (tree *expr_p, gimple_seq *pre_p) ...@@ -6346,14 +6424,13 @@ gimplify_omp_task (tree *expr_p, gimple_seq *pre_p)
tree expr = *expr_p; tree expr = *expr_p;
gimple g; gimple g;
gimple_seq body = NULL; gimple_seq body = NULL;
struct gimplify_ctx gctx;
gimplify_scan_omp_clauses (&OMP_TASK_CLAUSES (expr), pre_p, gimplify_scan_omp_clauses (&OMP_TASK_CLAUSES (expr), pre_p,
find_omp_clause (OMP_TASK_CLAUSES (expr), find_omp_clause (OMP_TASK_CLAUSES (expr),
OMP_CLAUSE_UNTIED) OMP_CLAUSE_UNTIED)
? ORT_UNTIED_TASK : ORT_TASK); ? ORT_UNTIED_TASK : ORT_TASK);
push_gimplify_context (&gctx); push_gimplify_context ();
g = gimplify_and_return_first (OMP_TASK_BODY (expr), &body); g = gimplify_and_return_first (OMP_TASK_BODY (expr), &body);
if (gimple_code (g) == GIMPLE_BIND) if (gimple_code (g) == GIMPLE_BIND)
...@@ -6751,8 +6828,7 @@ gimplify_omp_workshare (tree *expr_p, gimple_seq *pre_p) ...@@ -6751,8 +6828,7 @@ gimplify_omp_workshare (tree *expr_p, gimple_seq *pre_p)
gimplify_scan_omp_clauses (&OMP_CLAUSES (expr), pre_p, ort); gimplify_scan_omp_clauses (&OMP_CLAUSES (expr), pre_p, ort);
if (ort == ORT_TARGET || ort == ORT_TARGET_DATA) if (ort == ORT_TARGET || ort == ORT_TARGET_DATA)
{ {
struct gimplify_ctx gctx; push_gimplify_context ();
push_gimplify_context (&gctx);
gimple g = gimplify_and_return_first (OMP_BODY (expr), &body); gimple g = gimplify_and_return_first (OMP_BODY (expr), &body);
if (gimple_code (g) == GIMPLE_BIND) if (gimple_code (g) == GIMPLE_BIND)
pop_gimplify_context (g); pop_gimplify_context (g);
...@@ -6987,7 +7063,6 @@ gimplify_transaction (tree *expr_p, gimple_seq *pre_p) ...@@ -6987,7 +7063,6 @@ gimplify_transaction (tree *expr_p, gimple_seq *pre_p)
tree expr = *expr_p, temp, tbody = TRANSACTION_EXPR_BODY (expr); tree expr = *expr_p, temp, tbody = TRANSACTION_EXPR_BODY (expr);
gimple g; gimple g;
gimple_seq body = NULL; gimple_seq body = NULL;
struct gimplify_ctx gctx;
int subcode = 0; int subcode = 0;
/* Wrap the transaction body in a BIND_EXPR so we have a context /* Wrap the transaction body in a BIND_EXPR so we have a context
...@@ -7000,7 +7075,7 @@ gimplify_transaction (tree *expr_p, gimple_seq *pre_p) ...@@ -7000,7 +7075,7 @@ gimplify_transaction (tree *expr_p, gimple_seq *pre_p)
TRANSACTION_EXPR_BODY (expr) = bind; TRANSACTION_EXPR_BODY (expr) = bind;
} }
push_gimplify_context (&gctx); push_gimplify_context ();
temp = voidify_wrapper_expr (*expr_p, NULL); temp = voidify_wrapper_expr (*expr_p, NULL);
g = gimplify_and_return_first (TRANSACTION_EXPR_BODY (expr), &body); g = gimplify_and_return_first (TRANSACTION_EXPR_BODY (expr), &body);
...@@ -8358,7 +8433,6 @@ gimplify_body (tree fndecl, bool do_parms) ...@@ -8358,7 +8433,6 @@ gimplify_body (tree fndecl, bool do_parms)
location_t saved_location = input_location; location_t saved_location = input_location;
gimple_seq parm_stmts, seq; gimple_seq parm_stmts, seq;
gimple outer_bind; gimple outer_bind;
struct gimplify_ctx gctx;
struct cgraph_node *cgn; struct cgraph_node *cgn;
timevar_push (TV_TREE_GIMPLIFY); timevar_push (TV_TREE_GIMPLIFY);
...@@ -8368,7 +8442,7 @@ gimplify_body (tree fndecl, bool do_parms) ...@@ -8368,7 +8442,7 @@ gimplify_body (tree fndecl, bool do_parms)
default_rtl_profile (); default_rtl_profile ();
gcc_assert (gimplify_ctxp == NULL); gcc_assert (gimplify_ctxp == NULL);
push_gimplify_context (&gctx); push_gimplify_context ();
if (flag_openmp) if (flag_openmp)
{ {
......
...@@ -48,39 +48,10 @@ enum gimplify_status { ...@@ -48,39 +48,10 @@ enum gimplify_status {
GS_OK = 0, /* We did something, maybe more to do. */ GS_OK = 0, /* We did something, maybe more to do. */
GS_ALL_DONE = 1 /* The expression is fully gimplified. */ GS_ALL_DONE = 1 /* The expression is fully gimplified. */
}; };
/* Gimplify hashtable helper. */
struct gimplify_hasher : typed_free_remove <elt_t> extern void free_gimplify_stack (void);
{ extern void push_gimplify_context (bool in_ssa = false,
typedef elt_t value_type; bool rhs_cond_ok = false);
typedef elt_t compare_type;
static inline hashval_t hash (const value_type *);
static inline bool equal (const value_type *, const compare_type *);
};
struct gimplify_ctx
{
struct gimplify_ctx *prev_context;
vec<gimple> bind_expr_stack;
tree temps;
gimple_seq conditional_cleanups;
tree exit_label;
tree return_temp;
vec<tree> case_labels;
/* The formal temporary table. Should this be persistent? */
hash_table <gimplify_hasher> temp_htab;
int conditions;
bool save_stack;
bool into_ssa;
bool allow_rhs_cond_expr;
bool in_cleanup_point_expr;
};
extern struct gimplify_ctx *gimplify_ctxp;
extern void push_gimplify_context (struct gimplify_ctx *);
extern void pop_gimplify_context (gimple); extern void pop_gimplify_context (gimple);
extern gimple gimple_current_bind_expr (void); extern gimple gimple_current_bind_expr (void);
extern vec<gimple> gimple_bind_expr_stack (void); extern vec<gimple> gimple_bind_expr_stack (void);
......
...@@ -8351,11 +8351,10 @@ lower_omp_sections (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -8351,11 +8351,10 @@ lower_omp_sections (gimple_stmt_iterator *gsi_p, omp_context *ctx)
gimple_stmt_iterator tgsi; gimple_stmt_iterator tgsi;
gimple stmt, new_stmt, bind, t; gimple stmt, new_stmt, bind, t;
gimple_seq ilist, dlist, olist, new_body; gimple_seq ilist, dlist, olist, new_body;
struct gimplify_ctx gctx;
stmt = gsi_stmt (*gsi_p); stmt = gsi_stmt (*gsi_p);
push_gimplify_context (&gctx); push_gimplify_context ();
dlist = NULL; dlist = NULL;
ilist = NULL; ilist = NULL;
...@@ -8561,9 +8560,8 @@ lower_omp_single (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -8561,9 +8560,8 @@ lower_omp_single (gimple_stmt_iterator *gsi_p, omp_context *ctx)
tree block; tree block;
gimple t, bind, single_stmt = gsi_stmt (*gsi_p); gimple t, bind, single_stmt = gsi_stmt (*gsi_p);
gimple_seq bind_body, bind_body_tail = NULL, dlist; gimple_seq bind_body, bind_body_tail = NULL, dlist;
struct gimplify_ctx gctx;
push_gimplify_context (&gctx); push_gimplify_context ();
block = make_node (BLOCK); block = make_node (BLOCK);
bind = gimple_build_bind (NULL, NULL, block); bind = gimple_build_bind (NULL, NULL, block);
...@@ -8621,9 +8619,8 @@ lower_omp_master (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -8621,9 +8619,8 @@ lower_omp_master (gimple_stmt_iterator *gsi_p, omp_context *ctx)
gimple stmt = gsi_stmt (*gsi_p), bind; gimple stmt = gsi_stmt (*gsi_p), bind;
location_t loc = gimple_location (stmt); location_t loc = gimple_location (stmt);
gimple_seq tseq; gimple_seq tseq;
struct gimplify_ctx gctx;
push_gimplify_context (&gctx); push_gimplify_context ();
block = make_node (BLOCK); block = make_node (BLOCK);
bind = gimple_build_bind (NULL, NULL, block); bind = gimple_build_bind (NULL, NULL, block);
...@@ -8688,9 +8685,8 @@ lower_omp_ordered (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -8688,9 +8685,8 @@ lower_omp_ordered (gimple_stmt_iterator *gsi_p, omp_context *ctx)
{ {
tree block; tree block;
gimple stmt = gsi_stmt (*gsi_p), bind, x; gimple stmt = gsi_stmt (*gsi_p), bind, x;
struct gimplify_ctx gctx;
push_gimplify_context (&gctx); push_gimplify_context ();
block = make_node (BLOCK); block = make_node (BLOCK);
bind = gimple_build_bind (NULL, NULL, block); bind = gimple_build_bind (NULL, NULL, block);
...@@ -8734,7 +8730,6 @@ lower_omp_critical (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -8734,7 +8730,6 @@ lower_omp_critical (gimple_stmt_iterator *gsi_p, omp_context *ctx)
gimple stmt = gsi_stmt (*gsi_p), bind; gimple stmt = gsi_stmt (*gsi_p), bind;
location_t loc = gimple_location (stmt); location_t loc = gimple_location (stmt);
gimple_seq tbody; gimple_seq tbody;
struct gimplify_ctx gctx;
name = gimple_omp_critical_name (stmt); name = gimple_omp_critical_name (stmt);
if (name) if (name)
...@@ -8787,7 +8782,7 @@ lower_omp_critical (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -8787,7 +8782,7 @@ lower_omp_critical (gimple_stmt_iterator *gsi_p, omp_context *ctx)
unlock = build_call_expr_loc (loc, unlock, 0); unlock = build_call_expr_loc (loc, unlock, 0);
} }
push_gimplify_context (&gctx); push_gimplify_context ();
block = make_node (BLOCK); block = make_node (BLOCK);
bind = gimple_build_bind (NULL, NULL, block); bind = gimple_build_bind (NULL, NULL, block);
...@@ -8877,9 +8872,8 @@ lower_omp_for (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -8877,9 +8872,8 @@ lower_omp_for (gimple_stmt_iterator *gsi_p, omp_context *ctx)
gimple stmt = gsi_stmt (*gsi_p), new_stmt; gimple stmt = gsi_stmt (*gsi_p), new_stmt;
gimple_seq omp_for_body, body, dlist; gimple_seq omp_for_body, body, dlist;
size_t i; size_t i;
struct gimplify_ctx gctx;
push_gimplify_context (&gctx); push_gimplify_context ();
lower_omp (gimple_omp_for_pre_body_ptr (stmt), ctx); lower_omp (gimple_omp_for_pre_body_ptr (stmt), ctx);
...@@ -9094,7 +9088,6 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx) ...@@ -9094,7 +9088,6 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
bool record_needs_remap = false, srecord_needs_remap = false; bool record_needs_remap = false, srecord_needs_remap = false;
splay_tree_node n; splay_tree_node n;
struct omp_taskcopy_context tcctx; struct omp_taskcopy_context tcctx;
struct gimplify_ctx gctx;
location_t loc = gimple_location (task_stmt); location_t loc = gimple_location (task_stmt);
child_fn = gimple_omp_task_copy_fn (task_stmt); child_fn = gimple_omp_task_copy_fn (task_stmt);
...@@ -9107,7 +9100,7 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx) ...@@ -9107,7 +9100,7 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
DECL_CONTEXT (t) = child_fn; DECL_CONTEXT (t) = child_fn;
/* Populate the function. */ /* Populate the function. */
push_gimplify_context (&gctx); push_gimplify_context ();
push_cfun (child_cfun); push_cfun (child_cfun);
bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL); bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
...@@ -9387,7 +9380,6 @@ lower_omp_taskreg (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -9387,7 +9380,6 @@ lower_omp_taskreg (gimple_stmt_iterator *gsi_p, omp_context *ctx)
gimple stmt = gsi_stmt (*gsi_p); gimple stmt = gsi_stmt (*gsi_p);
gimple par_bind, bind, dep_bind = NULL; gimple par_bind, bind, dep_bind = NULL;
gimple_seq par_body, olist, ilist, par_olist, par_rlist, par_ilist, new_body; gimple_seq par_body, olist, ilist, par_olist, par_rlist, par_ilist, new_body;
struct gimplify_ctx gctx, dep_gctx;
location_t loc = gimple_location (stmt); location_t loc = gimple_location (stmt);
clauses = gimple_omp_taskreg_clauses (stmt); clauses = gimple_omp_taskreg_clauses (stmt);
...@@ -9412,7 +9404,7 @@ lower_omp_taskreg (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -9412,7 +9404,7 @@ lower_omp_taskreg (gimple_stmt_iterator *gsi_p, omp_context *ctx)
if (gimple_code (stmt) == GIMPLE_OMP_TASK if (gimple_code (stmt) == GIMPLE_OMP_TASK
&& find_omp_clause (clauses, OMP_CLAUSE_DEPEND)) && find_omp_clause (clauses, OMP_CLAUSE_DEPEND))
{ {
push_gimplify_context (&dep_gctx); push_gimplify_context ();
dep_bind = gimple_build_bind (NULL, NULL, make_node (BLOCK)); dep_bind = gimple_build_bind (NULL, NULL, make_node (BLOCK));
lower_depend_clauses (stmt, &dep_ilist, &dep_olist); lower_depend_clauses (stmt, &dep_ilist, &dep_olist);
} }
...@@ -9420,7 +9412,7 @@ lower_omp_taskreg (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -9420,7 +9412,7 @@ lower_omp_taskreg (gimple_stmt_iterator *gsi_p, omp_context *ctx)
if (ctx->srecord_type) if (ctx->srecord_type)
create_task_copyfn (stmt, ctx); create_task_copyfn (stmt, ctx);
push_gimplify_context (&gctx); push_gimplify_context ();
par_olist = NULL; par_olist = NULL;
par_ilist = NULL; par_ilist = NULL;
...@@ -9510,7 +9502,6 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -9510,7 +9502,6 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
gimple stmt = gsi_stmt (*gsi_p); gimple stmt = gsi_stmt (*gsi_p);
gimple tgt_bind = NULL, bind; gimple tgt_bind = NULL, bind;
gimple_seq tgt_body = NULL, olist, ilist, new_body; gimple_seq tgt_body = NULL, olist, ilist, new_body;
struct gimplify_ctx gctx;
location_t loc = gimple_location (stmt); location_t loc = gimple_location (stmt);
int kind = gimple_omp_target_kind (stmt); int kind = gimple_omp_target_kind (stmt);
unsigned int map_cnt = 0; unsigned int map_cnt = 0;
...@@ -9525,7 +9516,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -9525,7 +9516,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
tgt_body = gimple_omp_body (stmt); tgt_body = gimple_omp_body (stmt);
child_fn = ctx->cb.dst_fn; child_fn = ctx->cb.dst_fn;
push_gimplify_context (&gctx); push_gimplify_context ();
for (c = clauses; c ; c = OMP_CLAUSE_CHAIN (c)) for (c = clauses; c ; c = OMP_CLAUSE_CHAIN (c))
switch (OMP_CLAUSE_CODE (c)) switch (OMP_CLAUSE_CODE (c))
...@@ -9811,8 +9802,7 @@ static void ...@@ -9811,8 +9802,7 @@ static void
lower_omp_teams (gimple_stmt_iterator *gsi_p, omp_context *ctx) lower_omp_teams (gimple_stmt_iterator *gsi_p, omp_context *ctx)
{ {
gimple teams_stmt = gsi_stmt (*gsi_p); gimple teams_stmt = gsi_stmt (*gsi_p);
struct gimplify_ctx gctx; push_gimplify_context ();
push_gimplify_context (&gctx);
tree block = make_node (BLOCK); tree block = make_node (BLOCK);
gimple bind = gimple_build_bind (NULL, NULL, block); gimple bind = gimple_build_bind (NULL, NULL, block);
...@@ -10105,10 +10095,8 @@ execute_lower_omp (void) ...@@ -10105,10 +10095,8 @@ execute_lower_omp (void)
if (all_contexts->root) if (all_contexts->root)
{ {
struct gimplify_ctx gctx;
if (task_shared_vars) if (task_shared_vars)
push_gimplify_context (&gctx); push_gimplify_context ();
lower_omp (&body, NULL); lower_omp (&body, NULL);
if (task_shared_vars) if (task_shared_vars)
pop_gimplify_context (NULL); pop_gimplify_context (NULL);
......
...@@ -4519,7 +4519,6 @@ optimize_inline_calls (tree fn) ...@@ -4519,7 +4519,6 @@ optimize_inline_calls (tree fn)
copy_body_data id; copy_body_data id;
basic_block bb; basic_block bb;
int last = n_basic_blocks_for_fn (cfun); int last = n_basic_blocks_for_fn (cfun);
struct gimplify_ctx gctx;
bool inlined_p = false; bool inlined_p = false;
/* Clear out ID. */ /* Clear out ID. */
...@@ -4540,7 +4539,7 @@ optimize_inline_calls (tree fn) ...@@ -4540,7 +4539,7 @@ optimize_inline_calls (tree fn)
id.transform_lang_insert_block = NULL; id.transform_lang_insert_block = NULL;
id.statements_to_fold = pointer_set_create (); id.statements_to_fold = pointer_set_create ();
push_gimplify_context (&gctx); push_gimplify_context ();
/* We make no attempts to keep dominance info up-to-date. */ /* We make no attempts to keep dominance info up-to-date. */
free_dominance_info (CDI_DOMINATORS); free_dominance_info (CDI_DOMINATORS);
......
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