00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 #ifdef USE_PCH
00062 #include "opt_pch.h"
00063 #endif // USE_PCH
00064 #pragma hdrstop
00065
00066
00067 #include "erglob.h"
00068 #include "opt_htable.h"
00069 #include "opt_ssa.h"
00070 #include "opt_etable.h"
00071 #include "opt_estr.h"
00072 #include "opt_lftr2.h"
00073 #include "opt_config.h"
00074 #include "tracing.h"
00075 #include "config_targ.h"
00076 #include "opt_mu_chi.h"
00077 #include "opt_cvtl_rule.h"
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 class EOCC {
00088 private:
00089 CFG *_cfg;
00090 ETABLE *_etable;
00091 BOOL _tracing;
00092
00093 CFG *Cfg(void) const { return _cfg; }
00094 ETABLE *Etable(void) const { return _etable; }
00095
00096 public:
00097 EOCC(ETABLE *etab, CFG *cfg):
00098 _cfg(cfg), _etable(etab)
00099 {
00100 _tracing = etab->Tracing();
00101 }
00102
00103 ~EOCC(void) {}
00104
00105
00106 void Collect_real_occurrences( void );
00107
00108 BOOL Tracing(void) const { return _tracing; }
00109 };
00110
00111
00112
00113
00114 BOOL
00115 CODEREP::Exp_has_e_num(void) const
00116 {
00117 Is_True(Kind() == CK_OP, ("CODEREP::Oper_has_e_num: illegal kind."));
00118
00119 if (OPERATOR_is_volatile(Opr())) return FALSE;
00120
00121 switch (Opr()) {
00122 case OPR_CALL:
00123 case OPR_ICALL:
00124 case OPR_INTRINSIC_CALL:
00125 case OPR_ASM_INPUT:
00126 case OPR_ASM_STMT:
00127 return FALSE;
00128 case OPR_INTRINSIC_OP:
00129 return WOPT_Enable_Move_Intrinsicop;
00130 #ifdef KEY
00131 case OPR_PURE_CALL_OP:
00132 #endif
00133 case OPR_CVT:
00134
00135 case OPR_CVTL:
00136
00137 default:
00138 return TRUE;
00139 }
00140 }
00141
00142
00143
00144
00145
00146 BOOL
00147 CODEREP::Is_non_volatile_terminal(OPT_STAB *opt_stab) const
00148 {
00149 switch (Kind()) {
00150 case CK_CONST:
00151 case CK_RCONST:
00152 case CK_LDA:
00153 return TRUE;
00154 case CK_VAR:
00155 {
00156 if (Is_var_volatile()) return FALSE;
00157
00158 ST *s = opt_stab->St(Aux_id());
00159 if ((ST_class(s) == CLASS_PREG && Preg_Is_Dedicated(Offset())))
00160 return FALSE;
00161 return TRUE;
00162 }
00163 case CK_IVAR:
00164 if (Is_ivar_volatile()) return FALSE;
00165 if (Opr() == OPR_PARM && Ivar_mu_node() == NULL && WOPT_Enable_Move_Intrinsicop)
00166 return Ilod_base()->Is_non_volatile_terminal(opt_stab);
00167 #if 0
00168 if ((Opr() == OPR_CVT && Cvt_is_nop()) ||
00169 (Opr() == OPR_CVTL && Cvtl_is_nop()))
00170 return Opnd(0)->Is_non_volatile_terminal(opt_stab);
00171 #endif
00172 default:
00173 return FALSE;
00174 }
00175 }
00176
00177 void
00178 EOCC::Collect_real_occurrences( void )
00179 {
00180 BB_NODE *bb;
00181 DPOBB_ITER dpo_iter(Cfg());
00182 FOR_ALL_ELEM (bb, dpo_iter, Init()) {
00183
00184 Is_Trace(Tracing(),(TFile,
00185 "====== EOCC::Collect_real_occurrences, BB%d (dpo %d) ======\n",
00186 bb->Id(),dpo_iter.Cur()));
00187
00188 STMTREP_ITER stmt_iter(bb->Stmtlist());
00189 STMTREP *stmt;
00190 FOR_ALL_NODE(stmt, stmt_iter, Init()) {
00191
00192
00193
00194 if ( Etable()->Pre_kind() == PK_EPRE ) {
00195 OPERATOR stmt_opr = stmt->Opr();
00196 if (OPERATOR_is_scalar_store (stmt_opr) &&
00197 ST_class(Etable()->Opt_stab()->St(stmt->Lhs()->Aux_id()))
00198 != CLASS_PREG || OPERATOR_is_scalar_istore (stmt_opr) ||
00199 stmt_opr == OPR_ISTOREX) {
00200 CODEREP *rhs_cr = stmt->Rhs();
00201 CODEREP *lhs = stmt->Lhs();
00202 if (WOPT_Enable_Cvt_Folding && rhs_cr->Kind() == CK_OP &&
00203 #ifdef KEY // bug 11797
00204 ! MTYPE_is_vector(rhs_cr->Dsctyp()) &&
00205 ! MTYPE_is_vector(rhs_cr->Dtyp()) &&
00206 #endif
00207 (rhs_cr->Opr() == OPR_CVT && MTYPE_is_integral(rhs_cr->Dsctyp())
00208 || rhs_cr->Opr() == OPR_CVTL) &&
00209 #ifdef TARG_X8664
00210 !MTYPE_is_vector(lhs->Dsctyp()) &&
00211 #endif
00212 MTYPE_is_integral(rhs_cr->Dtyp()) &&
00213 MTYPE_is_integral(lhs->Dsctyp())
00214 ) {
00215 MTYPE actual_type;
00216 if (rhs_cr->Opr() == OPR_CVTL)
00217 actual_type = Actual_cvtl_type(rhs_cr->Op(),rhs_cr->Offset());
00218 else if (MTYPE_size_min(rhs_cr->Dsctyp()) <= MTYPE_size_min(rhs_cr->Dtyp()))
00219 actual_type = rhs_cr->Dsctyp();
00220 else
00221 actual_type = rhs_cr->Dtyp();
00222 if (MTYPE_size_min(lhs->Dsctyp()) <= MTYPE_size_min(actual_type)) {
00223 stmt->Set_rhs(rhs_cr->Get_opnd(0));
00224 }
00225 }
00226 }
00227 }
00228
00229
00230 stmt->Reset_RHS_saved();
00231 stmt->Reset_saved_RHS();
00232 if ( Etable()->Pre_kind() == PK_EPRE )
00233 Etable()->Bottom_up_stmt(stmt);
00234 else {
00235 Is_True(Etable()->Pre_kind() == PK_LPRE,
00236 ("EOCC::Collect_real_occurrences: illegal kind"));
00237 Etable()->LPRE_bottom_up_stmt(stmt);
00238 if (OPERATOR_is_scalar_store (stmt->Opr()))
00239 Etable()->Opt_stab()->Aux_stab_entry(stmt->Lhs()->Aux_id())->Set_has_store_in_PU();
00240 }
00241 }
00242
00243 if (bb->Kind() == BB_EXIT && bb != Cfg()->Fake_exit_bb())
00244 Etable()->Append_exit_occurrence(bb);
00245
00246 PHI_LIST *phi_list = bb->Phi_list();
00247 if (phi_list) {
00248 PHI_NODE *phi;
00249 PHI_LIST_ITER phi_iter;
00250 FOR_ALL_ELEM (phi, phi_iter, Init(phi_list)) {
00251 Is_Trace(Tracing(),(TFile,
00252 "====== EOCC::Collect_real_occurrences, Enter Phi ======\n"));
00253 Is_Trace_cmd(Tracing(),phi->Print(phi_list->In_degree(),TFile));
00254
00255
00256 if (Etable()->Pre_kind() == PK_EPRE &&
00257 WOPT_Enable_New_SR &&
00258 phi->Live() &&
00259
00260 Etable()->Str_red()->Determine_iv_update_phi(phi, NULL))
00261 {
00262 Is_Trace(Tracing(),(TFile,"-phi has iv update opnd-\n"));
00263 }
00264 }
00265 }
00266 }
00267
00268 if (Etable()->Lftr()->Lftr_on()) {
00269
00270
00271
00272
00273 Etable()->Lftr()->Remove_lftr_non_candidates();
00274 }
00275 }
00276
00277
00278 void
00279 ETABLE::Init_worklst(void)
00280 {
00281 EOCC eocc( this, Cfg() );
00282
00283
00284
00285 eocc.Collect_real_occurrences();
00286
00287 Is_Trace(Tracing(),(TFile, "====== ETABLE::Init_worklst ======\n"));
00288 }
00289
00290 static BOOL
00291 Is_same_location(const CODEREP *cr1, const CODEREP *cr2)
00292 {
00293 CODEREP *base1 = cr1->Ilod_base() ? cr1->Ilod_base() : cr1->Istr_base();
00294 CODEREP *base2 = cr2->Ilod_base() ? cr2->Ilod_base() : cr2->Istr_base();
00295 return ( ( base1 == base2 ) && ( cr1->Offset() == cr2->Offset() ) );
00296 }
00297
00298
00299
00300
00301
00302
00303
00304 static void
00305 Set_defphi_recursive(PHI_NODE *phi_node,
00306 BB_NODE_SET &phi_list,
00307 BOOL tracing,
00308 ETABLE *etable,
00309 BOOL handle_sr)
00310 {
00311 Is_True(phi_node, ("Set_defphi_recursive: Null PHI_NODE parameter"));
00312
00313 if (phi_node->Live()) {
00314 BB_NODE *bb = phi_node->Bb();
00315 if (!phi_list.MemberP(bb->Dom_dfs_id())) {
00316 Is_Trace(tracing,
00317 (TFile, "------ Enter Phi-node (by variable): %d ------\n",
00318 bb->Id()));
00319 phi_list.Union1D(bb->Dom_dfs_id());
00320 CODEREP *cr;
00321 PHI_NODE *defphi;
00322 for (INT i = 0; i < phi_node->Size(); ++i) {
00323 cr = phi_node->OPND(i);
00324 if (cr) {
00325 if ( handle_sr && cr->Kind() == CK_VAR ) {
00326 while (!cr->Is_flag_set((CR_FLAG) (CF_DEF_BY_PHI|
00327 CF_DEF_BY_CHI|
00328 CF_IS_ZERO_VERSION))) {
00329
00330 STMTREP *cr_def = cr->Defstmt();
00331 if (etable->Str_red()->Determine_iv_update(cr_def, NULL)) {
00332 CODEREP *new_cr, *dummy_incr;
00333 BOOL dummy_is_add;
00334 if (etable->Str_red()->
00335 Find_iv_and_incr(cr_def, &new_cr, &dummy_incr,
00336 &dummy_is_add)) {
00337 cr = new_cr;
00338 continue;
00339 }
00340 }
00341
00342 break;
00343 }
00344 }
00345
00346
00347 if (cr->Is_flag_set(CF_DEF_BY_PHI) &&
00348 ((defphi = cr->Defphi() ) != NULL)) {
00349 Set_defphi_recursive(defphi, phi_list, tracing, etable,
00350 handle_sr);
00351 }
00352 }
00353 }
00354 }
00355 }
00356 }
00357
00358
00359
00360
00361
00362
00363 static void
00364 Set_indirect_defphi_recursive(CODEREP *vsym, BB_NODE_SET &phi_list, BOOL tracing, CODEREP *ivar)
00365 {
00366 Is_True(vsym, ("Set_indirect defphi_recursive: new kid in town, missing road sign (Null vsym pointer)"));
00367
00368 PHI_NODE *phi_node;
00369 BB_NODE *bb;
00370 CODEREP *vsym_cur;
00371
00372 if ( vsym->Is_flag_set(CF_DEF_BY_PHI) ) {
00373 if ( ( ( phi_node = vsym->Defphi() ) != NULL ) && phi_node->Live() ) {
00374 bb = phi_node->Bb();
00375 if ( ! phi_list.MemberP( bb->Dom_dfs_id() ) ) {
00376 Is_Trace(tracing, (TFile, "------Enter Phi-node (by ivar): %d ------\n", bb->Id()));
00377 phi_list.Union1D( bb->Dom_dfs_id() );
00378 for (INT i = 0; i < phi_node->Size(); ++i) {
00379 if ( ( vsym_cur = phi_node->OPND(i) ) != NULL )
00380 Set_indirect_defphi_recursive(vsym_cur, phi_list, tracing, ivar);
00381 }
00382 }
00383 }
00384 }
00385 else if ( vsym->Is_flag_set(CF_DEF_BY_CHI) ) {
00386 CHI_NODE *chi_node = vsym->Defchi();
00387 if ( chi_node && chi_node->Live() &&
00388 ( ( vsym_cur = chi_node->OPND() ) != NULL ) ) {
00389 if ( vsym_cur->Is_flag_set(CF_IS_ZERO_VERSION) ) {
00390 Set_indirect_defphi_recursive(vsym_cur, phi_list, tracing, ivar);
00391 } else {
00392 STMTREP *defstmt = vsym->Defstmt();
00393 if ( ( defstmt == NULL ) || ! OPERATOR_is_store(defstmt->Opr()) )
00394 Set_indirect_defphi_recursive(vsym_cur, phi_list, tracing, ivar);
00395 else if ( (defstmt->Lhs()->Kind() != CK_IVAR) ||
00396 ! Is_same_location(defstmt->Lhs(), ivar) )
00397 Set_indirect_defphi_recursive(vsym_cur, phi_list, tracing, ivar);
00398 }
00399 }
00400 }
00401 }
00402
00403
00404
00405
00406
00407 void
00408 EXP_WORKLST::Generate_variable_phi_list(INT kid_number,
00409 BB_NODE_SET &var_phi_list,
00410 BOOL tracing,
00411 ETABLE *etable)
00412 {
00413 EXP_OCCURS *exp_occ;
00414 EXP_OCCURS_ITER exp_occ_iter;
00415 CODEREP *cr;
00416 PHI_NODE *phi_node;
00417
00418
00419 FOR_ALL_NODE (exp_occ, exp_occ_iter, Init(Real_occurs().Head())) {
00420 cr = exp_occ->Occurrence();
00421 Is_True(cr,("EXP_WORKLST::Generate_variable_phi_list: real occurrence with null CODEREP"));
00422 if ( Pre_kind() == PK_EPRE ) cr = cr->Opnd(kid_number);
00423 Is_True(cr,("EXP_WORKLST::Generate_variable_phi_list: real occurrence with null CODEREP as kid"));
00424 if ((cr->Kind()==CK_IVAR) && (cr->Opr()==OPR_PARM)) cr = cr->Ilod_base();
00425 Is_True(cr,("EXP_WORKLST::Generate_variable_phi_list: real occurrence with null CODEREP as kid"));
00426
00427
00428 if (!Exclude_sr_cand() && cr->Kind() == CK_VAR) {
00429 while (!cr->Is_flag_set(CF_DEF_BY_PHI) &&
00430 !cr->Is_flag_set(CF_DEF_BY_CHI)) {
00431
00432 STMTREP *cr_def = cr->Defstmt();
00433 if ( etable->Str_red()->Determine_iv_update(cr_def, NULL) ) {
00434 CODEREP *new_cr, *dummy_incr;
00435 BOOL dummy_is_add;
00436 if (etable->Str_red()->
00437 Find_iv_and_incr(cr_def, &new_cr, &dummy_incr, &dummy_is_add)) {
00438 cr = new_cr;
00439 continue;
00440 }
00441 }
00442
00443
00444 break;
00445 }
00446 }
00447
00448
00449 if (cr->Is_flag_set(CF_DEF_BY_PHI) &&
00450 ((phi_node = cr->Defphi()) != NULL))
00451 Set_defphi_recursive(phi_node, var_phi_list, tracing, etable,
00452 !Exclude_sr_cand() );
00453 }
00454 }
00455
00456
00457
00458
00459
00460 void
00461 EXP_WORKLST::Generate_ivariable_phi_list_addr(BB_NODE_SET &var_phi_list,
00462 BOOL tracing,
00463 ETABLE *etable)
00464 {
00465 Is_True(Exp()->Kind()==CK_IVAR, ("EXP_WORKLST::Generate_indirect_variable_phi_list: Exp is not a CK_IVAR"));
00466
00467 EXP_OCCURS *exp_occ;
00468 EXP_OCCURS_ITER exp_occ_iter;
00469 CODEREP *cr;
00470 PHI_NODE *phi_node;
00471
00472
00473 FOR_ALL_NODE (exp_occ, exp_occ_iter, Init(Real_occurs().Head())) {
00474 cr = exp_occ->Occurrence();
00475 Is_True(cr,("EXP_WORKLST::Generate_variable_phi_list: indirect occurrence with null CODEREP"));
00476 cr = cr->Ilod_base() ? cr->Ilod_base() : cr->Istr_base();
00477 Is_True(cr,("EXP_WORKLST::Generate_variable_phi_list: indirect occurrence with null CODEREP as Ilod_base() and Istr_base()"));
00478 if (cr->Is_flag_set(CF_DEF_BY_PHI) && ( (phi_node=cr->Defphi()) != NULL ))
00479 Set_defphi_recursive(phi_node, var_phi_list, tracing, etable, FALSE);
00480 }
00481 }
00482
00483
00484
00485
00486
00487
00488
00489
00490 void
00491 EXP_WORKLST::Generate_ivariable_phi_list_vsym(BB_NODE_SET &var_phi_list,
00492 BOOL tracing)
00493 {
00494 Is_True(Exp()->Kind()==CK_IVAR, ("EXP_WORKLST::Generate_indirect_variable_phi_list: Exp is not a CK_IVAR"));
00495
00496 EXP_OCCURS *exp_occ;
00497 EXP_OCCURS_ITER exp_occ_iter;
00498 CODEREP *cr;
00499 CODEREP *vsym;
00500
00501
00502 FOR_ALL_NODE (exp_occ, exp_occ_iter, Init(Real_occurs().Head())) {
00503 if (!exp_occ->Occurs_as_lvalue()) {
00504 cr = exp_occ->Occurrence();
00505 if (cr->Ivar_mu_node()) {
00506 vsym = cr->Ivar_mu_node()->OPND();
00507 if (vsym) Set_indirect_defphi_recursive(vsym, var_phi_list, tracing, cr);
00508 }
00509 }
00510 }
00511 }
00512
00513
00514
00515
00516
00517
00518 BOOL
00519 EXP_WORKLST::Insert_exp_phi(ETABLE *etable)
00520 {
00521 FmtAssert(etable,("EXP_WORKLST::Insert_exp_phi: Etable is NULL"));
00522
00523 Is_Trace(etable->Tracing(),
00524 (TFile, "====== ETABLE::Insert_phi_occurrences ======\n"));
00525 Is_Trace(etable->Tracing(),
00526 (TFile, "The real occurrence list is:\n"));
00527 Is_Trace_cmd(etable->Tracing(),Real_occurs().Print(TFile));
00528
00529
00530
00531 if (Real_occurs().Head() == Real_occurs().Tail() &&
00532 !Real_occurs().Head()->Mult_real() &&
00533 Real_occurs().Head()->Bb()->Dom_frontier()->EmptyP()) return FALSE;
00534
00535 BB_NODE_SET &phi_list = etable->Phi_work_set();
00536 BB_NODE_SET &var_phi_list = etable->Var_phi_set();
00537 BB_NODE_SET_ITER df_iter;
00538 EXP_OCCURS *exp_occ;
00539 EXP_OCCURS_ITER exp_occ_iter;
00540 BB_NODE *bb_orig;
00541 BB_NODE *bb_phi;
00542 MEM_POOL *local_pool = etable->Etable_local_pool();
00543 MEM_POOL *per_exp_pool = etable->Per_expr_pool();
00544
00545 OPT_POOL_Push(local_pool, -1);
00546 {
00547
00548 var_phi_list.ClearD();
00549 if ( Pre_kind() == PK_EPRE ) {
00550
00551 if (Exp()->Kind() != CK_IVAR) {
00552 for (INT i = 0; i < Exp()->Kid_count(); ++i) {
00553 phi_list.ClearD();
00554 Generate_variable_phi_list(i, phi_list, etable->Tracing(), etable);
00555 var_phi_list.UnionD(&phi_list);
00556 }
00557 } else if (Exp()->Ilod_base() || Exp()->Istr_base()) {
00558 phi_list.ClearD();
00559 Generate_ivariable_phi_list_addr(phi_list, etable->Tracing(), etable);
00560 var_phi_list.UnionD(&phi_list);
00561 phi_list.ClearD();
00562 Generate_ivariable_phi_list_vsym(phi_list, etable->Tracing());
00563 var_phi_list.UnionD(&phi_list);
00564 } else {
00565 FmtAssert(FALSE,("EXP_WORKLST::Insert_exp_phi: unhandled PRE candidate"));
00566 Exp()->Print(0,TFile);
00567 }
00568 } else if (Pre_kind() == PK_LPRE && Exp()->Kind() == CK_VAR) {
00569 phi_list.ClearD();
00570 Generate_variable_phi_list(-1, phi_list, etable->Tracing(), etable);
00571 var_phi_list.UnionD(&phi_list);
00572 }
00573
00574 BB_LIST_CONTAINER worklist;
00575
00576 phi_list.ClearD();
00577
00578 FOR_ALL_NODE (exp_occ, exp_occ_iter, Init(Real_occurs().Head())) {
00579 bb_orig = exp_occ->Bb();
00580 FOR_ALL_ELEM (bb_phi, df_iter, Init(bb_orig->Dom_frontier())) {
00581 if (!phi_list.MemberP(bb_phi->Dom_dfs_id())) {
00582 Is_Trace(etable->Tracing(),
00583 (TFile, "------ Enter Phi-node: %d ------\n",
00584 bb_phi->Id()));
00585 phi_list.Union1D(bb_phi->Dom_dfs_id());
00586 worklist.Append(bb_phi, local_pool);
00587 }
00588 }
00589 }
00590
00591 IDTYPE dpo_id;
00592 FOR_ALL_NODE (dpo_id, df_iter, Init(&var_phi_list)) {
00593 bb_phi = etable->Cfg()->Dpo_Bb(dpo_id);
00594 if (!phi_list.MemberP(dpo_id)) {
00595 worklist.Append(bb_phi, local_pool);
00596 }
00597 }
00598
00599 phi_list.UnionD(&var_phi_list);
00600
00601 while (bb_orig = worklist.Remove_head(local_pool)) {
00602 FOR_ALL_ELEM (bb_phi, df_iter, Init(bb_orig->Dom_frontier())) {
00603 if (!phi_list.MemberP(bb_phi->Dom_dfs_id())) {
00604 Is_Trace(etable->Tracing(),
00605 (TFile, "------ Enter Phi-node: %d ------\n",
00606 bb_phi->Id()));
00607 phi_list.Union1D(bb_phi->Dom_dfs_id());
00608 worklist.Append(bb_phi, local_pool);
00609 }
00610 }
00611 }
00612
00613
00614
00615 FOR_ALL_NODE (dpo_id, df_iter, Init(&phi_list)) {
00616 bb_phi = etable->Cfg()->Dpo_Bb(dpo_id);
00617 Is_Trace(etable->Tracing(),
00618 (TFile, "------ Generate EXP_PHI: %d ------\n", bb_phi->Id()));
00619 EXP_PHI *new_phi = CXX_NEW(EXP_PHI(E_num(),
00620 bb_phi->Phi_list()->In_degree(),
00621 bb_phi, per_exp_pool), per_exp_pool);
00622 EXP_OCCURS *new_occ = etable->Append_phi_occurrence(Exp(), new_phi, this);
00623 etable->Set_exp_phi_bb(bb_phi, new_occ);
00624 bb_phi->Set_exp_phi(new_phi);
00625 #if defined(TARG_SL)
00626
00627 if(bb_phi->SL2_para_region() && bb_phi->Preds_or_succs_from_different_region())
00628 new_phi->Set_not_down_safe();
00629 #endif
00630 }
00631
00632
00633 BB_LIST_ITER bb_iter;
00634 phi_list.ClearD();
00635 FOR_ALL_NODE (exp_occ, exp_occ_iter, Init(Phi_occurs().Head())) {
00636 bb_orig = exp_occ->Bb();
00637 FOR_ALL_ELEM (bb_phi, bb_iter, Init(bb_orig->Pred())) {
00638 Is_Trace(etable->Tracing(),
00639 (TFile, "------ Enter Phi-pred %d ------\n", bb_phi->Id()));
00640 phi_list.Union1D(bb_phi->Dom_dfs_id());
00641 }
00642 }
00643
00644 FOR_ALL_NODE (dpo_id, df_iter, Init(&phi_list)) {
00645 bb_orig = etable->Cfg()->Dpo_Bb(dpo_id);
00646 Is_Trace(etable->Tracing(),
00647 (TFile,"------ Generate Phi-pred occurrence %d ------\n",
00648 bb_orig->Id()));
00649 EXP_OCCURS *phi_pred = etable->Append_phi_pred_occurrence(Exp(), bb_orig, this);
00650 FOR_ALL_ELEM (bb_phi, bb_iter, Init(bb_orig->Succ())) {
00651 EXP_PHI *exp_phi = etable->Lookup_exp_phi(bb_phi, Exp());
00652 if (exp_phi != NULL) {
00653 INT32 opnd_num = bb_phi->Pred()->Pos(bb_orig);
00654 exp_phi->Set_pred(opnd_num, phi_pred);
00655 }
00656 }
00657 }
00658
00659 }
00660 OPT_POOL_Pop(local_pool, -1);
00661
00662 return TRUE;
00663 }