delete_loop (next);
next = ln;
}
- rewrite_into_loop_closed_ssa_1 (NULL, 0, SSA_OP_USE, loop);
}
/* Return true if any of the access functions for dataref A
if (todo)
{
+ rewrite_into_loop_closed_ssa (NULL, 0);
scev_reset ();
free_dominance_info (CDI_DOMINATORS);
}
if (preds)
preds->safe_push (g);
gsi_insert_before (&gsi, g, GSI_SAME_STMT);
- update_ssa (TODO_update_ssa);
+ update_ssa (TODO_update_ssa_no_phi);
return new_loop;
}
gimple_stmt_iterator cond_gsi = gsi_last_bb (cond_bb);
gsi_insert_seq_before (&cond_gsi, cond_stmts, GSI_SAME_STMT);
}
- update_ssa (TODO_update_ssa);
+ update_ssa (TODO_update_ssa_no_phi);
}
/* Return true if loop versioning is needed to distrubute PARTITIONS.
tree control = gimple_cond_lhs (cond_stmt);
edge e;
- /* Rewriting virtuals into loop-closed ssa normal form makes this
- transformation simpler. It also ensures that the virtuals are in
- loop-closed ssa normal from after the transformation, which is required by
- create_parallel_loop. */
- rewrite_virtuals_into_loop_closed_ssa (loop);
-
/* Create the new_header block. */
basic_block new_header = split_block_before_cond_jump (exit->src);
edge edge_at_split = single_pred_edge (new_header);
checking_verify_loop_structure ();
- todo |= TODO_update_ssa;
+ update_ssa (TODO_update_ssa);
+ if (in_loop_pipeline)
+ rewrite_into_loop_closed_ssa (NULL, 0);
}
if (!in_loop_pipeline)
{
/* Virtual PHI nodes with one or identical arguments
can be removed. */
- if (degenerate_phi_p (phi))
+ if (!loops_state_satisfies_p (LOOP_CLOSED_SSA)
+ && degenerate_phi_p (phi))
{
tree vdef = gimple_phi_result (phi);
tree vuse = gimple_phi_arg_def (phi, 0);
UPDATE_FLAG is used in the call to update_ssa. See
TODO_update_ssa* for documentation. */
-void
+static void
rewrite_into_loop_closed_ssa_1 (bitmap changed_bbs, unsigned update_flag,
int use_flags, class loop *loop)
{
free (use_blocks);
}
-/* Rewrites the non-virtual defs and uses into a loop closed ssa form. If
- CHANGED_BBS is not NULL, we look for uses outside loops only in the basic
+/* Rewrites the defs and uses into a loop closed ssa form.
+ If CHANGED_BBS is not NULL, we look for uses outside loops only in the basic
blocks in this set. UPDATE_FLAG is used in the call to update_ssa. See
TODO_update_ssa* for documentation. */
void
rewrite_into_loop_closed_ssa (bitmap changed_bbs, unsigned update_flag)
{
- rewrite_into_loop_closed_ssa_1 (changed_bbs, update_flag, SSA_OP_USE, NULL);
-}
-
-/* Rewrites virtual defs and uses with def in LOOP into loop closed ssa
- form. */
-
-void
-rewrite_virtuals_into_loop_closed_ssa (class loop *loop)
-{
- rewrite_into_loop_closed_ssa_1 (NULL, 0, SSA_OP_VIRTUAL_USES, loop);
+ rewrite_into_loop_closed_ssa_1 (changed_bbs, update_flag,
+ SSA_OP_ALL_USES, NULL);
}
/* Check invariants of the loop closed ssa form for the def in DEF_BB. */
{
gphi *phi = bsi.phi ();
- if (!virtual_operand_p (PHI_RESULT (phi)))
- check_loop_closed_ssa_def (bb, PHI_RESULT (phi));
+ check_loop_closed_ssa_def (bb, PHI_RESULT (phi));
}
for (gimple_stmt_iterator bsi = gsi_start_nondebug_bb (bb); !gsi_end_p (bsi);
tree var;
gimple *stmt = gsi_stmt (bsi);
- FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_DEF)
+ FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_DEFS)
check_loop_closed_ssa_def (bb, var);
}
}
extern void create_iv (tree, tree, tree, class loop *, gimple_stmt_iterator *,
bool, tree *, tree *);
-extern void rewrite_into_loop_closed_ssa_1 (bitmap, unsigned, int,
- class loop *);
extern void rewrite_into_loop_closed_ssa (bitmap, unsigned);
-extern void rewrite_virtuals_into_loop_closed_ssa (class loop *);
extern void verify_loop_closed_ssa (bool, class loop * = NULL);
static inline void
free_original_copy_tables ();
/* Update the SSA form after unswitching. */
- update_ssa (TODO_update_ssa);
+ update_ssa (TODO_update_ssa_no_phi);
/* Invoke itself on modified loops. */
bitmap handled_copy = BITMAP_ALLOC (NULL);
auto_vec<gimple *> dbg_to_reset;
while ((guard = find_loop_guard (loop, dbg_to_reset)))
{
- if (! changed)
- rewrite_virtuals_into_loop_closed_ssa (loop);
hoist_guard (loop, guard);
for (gimple *debug_stmt : dbg_to_reset)
{
}
}
- update_ssa (TODO_update_ssa);
+ update_ssa (TODO_update_ssa_no_phi);
}
/* Split the cost model check off to a separate BB. Costing assumes