- for (phi = phi_nodes (bb); phi; phi = next)
- {
- tree var = SSA_NAME_VAR (PHI_RESULT (phi));
-
- next = PHI_CHAIN (phi);
- /* Only add PHI nodes for variables not in VARS. */
- if (!bitmap_bit_p (vars, var_ann (var)->uid))
- {
- /* If we're not removing this PHI node, then it must have
- been rewritten by a previous call into the SSA rewriter.
- Note that fact in PHI_REWRITTEN. */
- PHI_REWRITTEN (phi) = 1;
-
- *lastp = phi;
- lastp = &PHI_CHAIN (phi);
- }
- else
- {
- /* If we are deleting the PHI node, then we should release the
- SSA_NAME node so that it can be reused. */
- release_ssa_name (PHI_RESULT (phi));
- release_phi_node (phi);
- }
- }
-
- /* Make sure the last node in the new list has no successors. */
- *lastp = NULL;
- bb_ann (bb)->phi_nodes = new_phi_list;
-
-#if defined ENABLE_CHECKING
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- {
- tree var = SSA_NAME_VAR (PHI_RESULT (phi));
- gcc_assert (!bitmap_bit_p (vars, var_ann (var)->uid));
- }
-#endif
- }
-}
-
-/* Reverse the order of PHI nodes in the chain PHI.
- Return the new head of the chain (old last PHI node). */
-
-tree
-phi_reverse (tree phi)
-{
- tree prev = NULL_TREE, next;
- for (; phi; phi = next)
- {
- next = PHI_CHAIN (phi);
- PHI_CHAIN (phi) = prev;
- prev = phi;
- }
- return prev;