Generating a phi node

Sebastian Pop sebpop@gmail.com
Wed Jun 13 18:52:00 GMT 2007


On 6/13/07, Revital1 Eres <ERES@il.ibm.com> wrote:
>
> Hello,
>
> I have two ssa vars (i0 and i1 in the following example); what is the
> sequence to generate a new phi node corresponding to i3 -
>
> if (...)
>      i0 = exp1
>
> else
>      i1 = exp2
>
> i3 = PHI(i0 , i1);
>

>From tree-vectorizer.c,

      /* 1.1. Generate new phi node in NEW_MERGE_BB:  */
      new_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (orig_phi)),
                                 new_merge_bb);

      /* 1.2. NEW_MERGE_BB has two incoming edges: GUARD_EDGE and the exit-edge
            of LOOP. Set the two phi args in NEW_PHI for these edges:  */
      loop_arg = PHI_ARG_DEF_FROM_EDGE (orig_phi, EDGE_SUCC (loop->latch, 0));
      guard_arg = PHI_ARG_DEF_FROM_EDGE (orig_phi, loop_preheader_edge (loop));

      add_phi_arg (new_phi, loop_arg, new_exit_e);
      add_phi_arg (new_phi, guard_arg, guard_edge);



More information about the Gcc mailing list