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 #define __STDC_LIMIT_MACROS
00053 #include <stdint.h>
00054 #if defined(BUILD_OS_DARWIN)
00055 #include <darwin_elf.h>
00056 #else
00057 #include <elf.h>
00058 #endif
00059 #include "defs.h"
00060 #include "stab.h"
00061 #include "wn.h"
00062 #include "targ_sim.h"
00063
00064
00065 #include "cxx_template.h"
00066 #include "cxx_memory.h"
00067
00068 #include "opt_du.h"
00069
00070 #include "ipl_summary.h"
00071 #include "ipl_summarize.h"
00072 #include "ipl_summarize_util.h"
00073 #include "ipl_main.h"
00074
00075 #ifndef opt_emit_INCLUDED
00076 #include "opt_emit.h"
00077 #endif // opt_emit_INCLUDED
00078
00079 #ifndef fb_whirl_INCLUDED
00080 #include "fb_whirl.h"
00081 #endif // fb_whirl_INCLUDED
00082
00083 #pragma weak Def_at_entry__7CODEREPCGv
00084 #pragma weak Print_kind__7CODEREPCGv
00085
00086
00087
00088 CHI_CR_TO_INT_MAP* Chi_To_Idx_Map;
00089 CHI_CR_ARRAY* Hashed_Chis;
00090 INT Num_Chis_On_PU_Start;
00091
00092 PHI_NODE_TO_INT_MAP* Phi_To_Idx_Map;
00093 PHI_NODE_ARRAY* Hashed_Phis;
00094 INT Num_Phis_On_PU_Start;
00095
00096
00097 #if (!defined(_STANDALONE_INLINER) && !defined(_LIGHTWEIGHT_INLINER))
00098
00099
00100 INT32 IPL_get_callsite_id(WN* w)
00101 {
00102 FmtAssert(WN_operator(w) == OPR_CALL
00103 || WN_operator(w) == OPR_ICALL
00104 || WN_operator(w) == OPR_INTRINSIC_CALL,
00105 ("IPL_get_callsite_id: Expecting CALL node"));
00106
00107 return
00108 WN_MAP32_Get(Summary_Map, w) - 1;
00109 }
00110 #endif
00111
00112
00113
00114 WN* IPL_get_stmt_scf(WN* av)
00115 {
00116 BOOL done = FALSE;
00117 WN* parent_w = NULL;
00118
00119 parent_w = av;
00120 while (!done)
00121 {
00122 parent_w = LWN_Get_Parent(parent_w);
00123 if (parent_w == NULL)
00124 done = TRUE;
00125 else if (OPCODE_is_stmt(WN_opcode(parent_w)) ||
00126 OPCODE_is_scf(WN_opcode(parent_w)))
00127 return parent_w;
00128 }
00129
00130 Fail_FmtAssertion("NULL wn in Get_stmt_scf\n");
00131 return NULL;
00132
00133 }
00134
00135
00136
00137
00138 INT
00139 IPL_deepest_depth(WN* w)
00140 {
00141 SUMMARY_CONTROL_DEPENDENCE *d;
00142 INT depth = 0;
00143 WN* control_node = NULL;
00144
00145 WN* stmt = IPL_get_stmt_scf(w);
00146
00147 d = Get_controlling_stmt(stmt);
00148 while (d)
00149 {
00150 if (d->Is_do_loop())
00151 ++depth;
00152 control_node = d->Get_wn();
00153 d = Get_controlling_stmt(control_node);
00154 }
00155 return depth;
00156 }
00157
00158
00159
00160
00161
00162
00163
00164 WN*
00165 LNO_Common_Loop(WN* wn1, WN* wn2)
00166 {
00167 const INT IPL_max_do_loop_depth = 128;
00168
00169 WN* parent;
00170
00171 WN* l1[IPL_max_do_loop_depth];
00172 INT i1 = 0;
00173
00174 if (WN_operator(wn1) == OPR_DO_LOOP) {
00175 l1[i1++] = wn1;
00176 }
00177 while (parent = LWN_Get_Parent(wn1)) {
00178 if (WN_operator(parent) == OPR_DO_LOOP) {
00179 if (WN_do_body(parent) == wn1 || WN_step(parent) == wn1) {
00180 l1[i1++] = parent;
00181 }
00182 }
00183 wn1 = parent;
00184 }
00185
00186 WN* l2[IPL_max_do_loop_depth];
00187 INT i2 = 0;
00188
00189 if (WN_operator(wn2) == OPR_DO_LOOP) {
00190 l2[i2++] = wn2;
00191 }
00192 while (parent = LWN_Get_Parent(wn2)) {
00193 if (WN_operator(parent) == OPR_DO_LOOP) {
00194 if (WN_do_body(parent) == wn2 || WN_step(parent) == wn2) {
00195 l2[i2++] = parent;
00196 }
00197 }
00198 wn2 = parent;
00199 }
00200
00201 WN* answer = NULL;
00202 while (i1 >= 1 && i2 >= 1 && l1[i1-1] == l2[i2-1]) {
00203 answer = l1[i1-1];
00204 i1--, i2--;
00205 }
00206
00207 return answer;
00208 }
00209
00210
00211
00212 AUX_SYMBOL_INFO Aux_Symbol_Info (1);
00213 AUX_SYMBOL_ACCESS Aux_Symbol;
00214
00215 void
00216 Init_Aux_Symbol_Info (SYMTAB_IDX level)
00217 {
00218 FmtAssert (Aux_Symbol_Info.size () >= level,
00219 ("Processing a nested procedure before it's parent"));
00220
00221
00222 while (Aux_Symbol_Info.size () > level)
00223 Aux_Symbol_Info.pop_back ();
00224
00225
00226 UINT32 table_size = ST_Table_Size (level);
00227
00228 typedef AUX_SYMBOL_INFO::value_type AUX_ST_INFO;
00229
00230 AUX_ST_INFO new_level (table_size);
00231 Aux_Symbol_Info.push_back (AUX_ST_INFO ());
00232 AUX_ST_INFO& st_info = Aux_Symbol_Info.back ();
00233 st_info.swap (new_level);
00234
00235 }
00236
00237
00238
00239
00240
00241 void
00242 Set_lang (SUMMARY_PROCEDURE *proc)
00243 {
00244 switch (PU_src_lang (Get_Current_PU ())) {
00245 case PU_C_LANG:
00246 proc->Set_lang (LANG_ANSI_C);
00247 break;
00248
00249 case PU_CXX_LANG:
00250 proc->Set_lang (LANG_CPLUS);
00251 break;
00252
00253 case PU_F77_LANG:
00254 proc->Set_lang (LANG_F77);
00255 break;
00256
00257 case PU_F90_LANG:
00258 proc->Set_lang (LANG_F90);
00259 break;
00260 }
00261 }
00262
00263
00264
00265
00266
00267
00268
00269 FLD_HANDLE
00270 get_field_entry_nme (TY_IDX t, STR_IDX nme)
00271 {
00272 FLD_ITER fld_iter = Make_fld_iter (TY_fld (Ty_Table[t]));
00273
00274 do {
00275 FLD_HANDLE fld (fld_iter);
00276 if (FLD_name_idx (fld) == nme)
00277 return fld;
00278 } while (!FLD_last_field (fld_iter++));
00279
00280 Fail_FmtAssertion("null field entry for common? \n");
00281
00282 return fld_iter;
00283 }
00284
00285
00286
00287
00288 BOOL
00289 Fortran_string_compare (char *pragma, char *func)
00290 {
00291 INT p_len = strlen (pragma);
00292 INT f_len = strlen (func);
00293
00294 if (p_len + 1 != f_len)
00295 return FALSE;
00296
00297 return (strncasecmp (pragma, func, p_len) == 0 && func[f_len-1] == '_');
00298
00299 }
00300
00301
00302
00303
00304 WN *
00305 get_mod_target (WN *wn)
00306 {
00307 OPERATOR opr = WN_operator (wn);
00308 INT i;
00309
00310 if (!OPERATOR_is_expression (WN_operator(wn)))
00311 return 0;
00312
00313 switch (opr) {
00314 case OPR_LDA:
00315 return wn;
00316
00317 case OPR_ARRAY:
00318 return get_mod_target (WN_array_base(wn));
00319
00320 case OPR_ILOAD:
00321 case OPR_LDID:
00322 return 0;
00323
00324 default:
00325 for (i = 0; i < WN_kid_count(wn); i++) {
00326 WN *w = get_mod_target (WN_kid(wn, i));
00327 if (w)
00328 return w;
00329 }
00330 }
00331
00332 return 0;
00333
00334 }
00335
00336
00337 void
00338 Inc_modcount (SUMMARY_GLOBAL *global, SUMMARY_SYMBOL *symbol, const WN *rhs)
00339 {
00340 OPERATOR opr = WN_operator(rhs);
00341
00342 if (symbol->Is_cmod()) {
00343 if (opr != OPR_INTCONST ||
00344 symbol->Get_const_value () != WN_const_val(rhs)) {
00345 symbol->Clear_cmod ();
00346 symbol->Clear_const_value ();
00347 }
00348 } else if (!symbol->Is_modcount () && opr == OPR_INTCONST) {
00349 symbol->Set_cmod ();
00350 symbol->Set_const_value (WN_const_val(rhs));
00351 }
00352 global->Inc_modcount ();
00353 symbol->Set_modcount ();
00354 }
00355
00356 #ifndef _LIGHTWEIGHT_INLINER
00357
00358
00359
00360
00361 BOOL
00362 Is_Value_Restored (WN *w, WN *orig_w, WN_MAP wn_to_cr_map)
00363 {
00364 WN *wn_ldid = WN_kid0(w);
00365 OPCODE op_ldid = WN_opcode(wn_ldid);
00366
00367 if (OPCODE_operator (op_ldid) != OPR_LDID)
00368 return FALSE;
00369
00370 if (WN_desc(orig_w) != OPCODE_rtype(op_ldid))
00371 return FALSE;
00372
00373 CODEREP *cr = (CODEREP *) WN_MAP_Get (wn_to_cr_map, wn_ldid);
00374
00375 if (cr == NULL || cr->Kind () != CK_VAR || cr->Is_flag_set (CF_DEF_BY_PHI))
00376 return FALSE;
00377
00378 if (cr->Def_at_entry ()) {
00379 if (WN_st(wn_ldid) == WN_st(orig_w) &&
00380 WN_store_offset(orig_w) == WN_load_offset(wn_ldid))
00381 return TRUE;
00382 } else {
00383
00384 if (cr->Is_flag_set (CF_DEF_BY_CHI))
00385 return FALSE;
00386
00387 STMTREP *stmt = cr->Defstmt ();
00388 if (stmt == NULL)
00389
00390 return FALSE;
00391
00392 WN *def = stmt->Wn();
00393
00394 if (WN_operator (def) == OPR_STID)
00395 return Is_Value_Restored (def, orig_w, wn_to_cr_map);
00396 }
00397
00398 return FALSE;
00399 }
00400 #endif
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415 typedef DYN_ARRAY<SUMMARY_STMT> STMT_ARRAY;
00416 typedef DYN_ARRAY<INT> STMT_ID_ARRAY;
00417 typedef DYN_ARRAY<WN *> WN_ARRAY;
00418
00419 class CTRL_DEP {
00420 private:
00421
00422 SUMMARY_CONTROL_DEPENDENCE _cd;
00423
00424 STMT_ARRAY _true_stmts;
00425 STMT_ARRAY _false_stmts;
00426
00427
00428
00429 WN_ARRAY _true_wns;
00430 WN_ARRAY _false_wns;
00431
00432
00433 STMT_ID_ARRAY _true_stmt_id;
00434 STMT_ID_ARRAY _false_stmt_id;
00435
00436 INT _true_call_count;
00437 INT _false_call_count;
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449 BOOL _head_of_chain;
00450
00451 INT ctrl_index;
00452
00453
00454 public:
00455
00456
00457
00458 SUMMARY_CONTROL_DEPENDENCE *Get_cd () { return &_cd; }
00459
00460 SUMMARY_STMT *Get_true_stmts () const { return &(_true_stmts[0]); }
00461 SUMMARY_STMT *Get_false_stmts () const { return &(_false_stmts[0]); }
00462
00463 WN **Get_true_wns () const { return &(_true_wns[0]); }
00464 WN **Get_false_wns () const { return &(_false_wns[0]); }
00465
00466 INT Get_true_stmt_id (INT idx) const { return _true_stmt_id[idx]; }
00467 INT Get_false_stmt_id (INT idx) const { return _false_stmt_id[idx]; }
00468
00469 void Reset_true_stmts (INT idx) {
00470 _true_stmts.Setidx (idx);
00471 _true_wns.Setidx (idx);
00472 _true_stmt_id.Setidx (idx);
00473 _cd.Set_true_count (idx + 1);
00474 }
00475
00476 void Reset_false_stmts (INT idx) {
00477 _false_stmts.Setidx (idx);
00478 _false_wns.Setidx (idx);
00479 _false_stmt_id.Setidx (idx);
00480 _cd.Set_false_count (idx + 1);
00481 }
00482
00483
00484 void Inc_call_count (BOOL branch) {
00485 if (branch)
00486 ++_true_call_count;
00487 else
00488 ++_false_call_count;
00489 }
00490 INT Get_call_count () const {
00491 return _true_call_count + _false_call_count;
00492 }
00493 INT Get_call_count (BOOL branch) const {
00494 return branch ? _true_call_count : _false_call_count;
00495 }
00496
00497 void Set_head_of_chain () { _head_of_chain = TRUE; }
00498 BOOL Is_head_of_chain () const { return _head_of_chain; }
00499
00500 void Set_ctrl_index (INT idx) { ctrl_index = idx; }
00501 INT Get_ctrl_index () const { return ctrl_index; }
00502
00503
00504
00505 void Init () {
00506 BZERO (this, sizeof(CTRL_DEP));
00507 _head_of_chain = FALSE;
00508 }
00509
00510 inline SUMMARY_STMT *Get_new_stmt (BOOL branch, WN *w);
00511 inline SUMMARY_STMT *Get_last_stmt (BOOL branch);
00512
00513 };
00514
00515
00516 typedef DYN_ARRAY<CTRL_DEP> CTRL_DEP_ARRAY;
00517 static CTRL_DEP_ARRAY *cdg;
00518 static MEM_POOL *CTRL_DEP_mem;
00519 static INT stmt_id;
00520 static INT iterator_idx;
00521
00522
00523
00524 inline SUMMARY_STMT *
00525 CTRL_DEP::Get_new_stmt (BOOL branch, WN *w)
00526 {
00527 INT idx;
00528
00529 if (branch == TRUE) {
00530 if (_cd.Get_true_count () == 0) {
00531 new (&_true_stmts) STMT_ARRAY (CTRL_DEP_mem);
00532 new (&_true_wns) WN_ARRAY (CTRL_DEP_mem);
00533 new (&_true_stmt_id) STMT_ID_ARRAY (CTRL_DEP_mem);
00534 }
00535 _true_stmt_id.AddElement (++stmt_id);
00536 _true_wns.AddElement (w);
00537 idx = _true_stmts.Newidx ();
00538 _cd.Set_true_count (idx + 1);
00539 _true_stmts[idx].Init ();
00540 return &(_true_stmts[idx]);
00541 } else {
00542 if (_cd.Get_false_count () == 0) {
00543 new (&_false_stmts) STMT_ARRAY (CTRL_DEP_mem);
00544 new (&_false_wns) WN_ARRAY (CTRL_DEP_mem);
00545 new (&_false_stmt_id) STMT_ID_ARRAY (CTRL_DEP_mem);
00546 }
00547 _false_stmt_id.AddElement (++stmt_id);
00548 _false_wns.AddElement (w);
00549 idx = _false_stmts.Newidx ();
00550 _cd.Set_false_count (idx + 1);
00551 _false_stmts[idx].Init ();
00552 return &(_false_stmts[idx]);
00553 }
00554 }
00555
00556
00557 inline SUMMARY_STMT *
00558 CTRL_DEP::Get_last_stmt (BOOL branch)
00559 {
00560 if (branch == TRUE) {
00561 if (_cd.Get_true_count () == 0)
00562 return 0;
00563 return &(_true_stmts[_true_stmts.Lastidx()]);
00564 } else {
00565 if (_cd.Get_false_count () == 0)
00566 return 0;
00567 return &(_false_stmts[_false_stmts.Lastidx()]);
00568 }
00569
00570 }
00571
00572 void
00573 Init_cdg (MEM_POOL *m)
00574 {
00575 CTRL_DEP_mem = m;
00576 cdg = CXX_NEW (CTRL_DEP_ARRAY (m), m);
00577 iterator_idx = -1;
00578 stmt_id = 0;
00579 }
00580
00581
00582 INT
00583 Get_stmt_id (void)
00584 {
00585 return stmt_id;
00586 }
00587
00588
00589 void
00590 Reset_cd_and_stmt (WN_MAP Summary_Map, INT saved_cd_idx, INT saved_stmt_id)
00591 {
00592 if (stmt_id > saved_stmt_id) {
00593 for (INT cd_idx = cdg->Lastidx (); cd_idx >= 0; --cd_idx) {
00594 if (cd_idx > saved_cd_idx)
00595 continue;
00596 CTRL_DEP &p = (*cdg)[cd_idx];
00597 INT stmt_idx = p.Get_cd()->Get_true_count ();
00598 BOOL need_to_reset = FALSE;
00599 while (--stmt_idx >= 0 &&
00600 p.Get_true_stmt_id (stmt_idx) > saved_stmt_id)
00601 need_to_reset = TRUE;
00602 if (need_to_reset)
00603 p.Reset_true_stmts (stmt_idx);
00604
00605 stmt_idx = p.Get_cd ()->Get_false_count ();
00606 need_to_reset = FALSE;
00607 while (--stmt_idx >= 0 &&
00608 p.Get_false_stmt_id (stmt_idx) > saved_stmt_id)
00609 need_to_reset = TRUE;
00610 if (need_to_reset)
00611 p.Reset_false_stmts (stmt_idx);
00612 }
00613 }
00614
00615 while (saved_cd_idx < cdg->Lastidx ()) {
00616 WN_MAP32_Set (Summary_Map, (*cdg)[cdg->Lastidx()].Get_cd ()->Get_wn (),
00617 0);
00618 cdg->Decidx ();
00619 }
00620
00621 }
00622
00623
00624 SUMMARY_CONTROL_DEPENDENCE *
00625 Get_new_cd (void)
00626 {
00627 INT idx = cdg->Newidx ();
00628 (*cdg)[idx].Init ();
00629 return (*cdg)[idx].Get_cd ();
00630 }
00631
00632
00633
00634 SUMMARY_CONTROL_DEPENDENCE *
00635 Get_cd_by_idx (INT idx)
00636 {
00637 if (idx <= cdg->Lastidx())
00638 return (*cdg)[idx].Get_cd ();
00639 else
00640 return NULL;
00641 }
00642
00643
00644 INT Get_max_cd_idx()
00645 {
00646 return cdg->Lastidx();
00647 }
00648
00649
00650 INT
00651 Get_cd_idx (SUMMARY_CONTROL_DEPENDENCE *cd)
00652 {
00653 return cdg->Idx ((CTRL_DEP *) cd);
00654 }
00655
00656
00657 void
00658 Inc_cd_call_count (INT idx, BOOL branch)
00659 {
00660 (*cdg)[idx].Inc_call_count (branch);
00661 }
00662
00663 INT
00664 Get_cd_call_count (INT idx)
00665 {
00666 return (*cdg)[idx].Get_call_count ();
00667 }
00668
00669 INT
00670 Get_cd_call_count (INT idx, BOOL branch)
00671 {
00672 return (*cdg)[idx].Get_call_count (branch);
00673 }
00674
00675 void
00676 Set_cd_head_of_chain (INT idx)
00677 {
00678 (*cdg)[idx].Set_head_of_chain ();
00679
00680 }
00681
00682
00683 void
00684 Set_cd_ctrl_index (SUMMARY_CONTROL_DEPENDENCE *cd, INT index)
00685 {
00686 INT idx = cdg->Idx ((CTRL_DEP *) cd);
00687
00688 (*cdg)[idx].Set_ctrl_index (index);
00689 }
00690
00691
00692 INT
00693 Get_cd_real_idx (SUMMARY_CONTROL_DEPENDENCE *cd)
00694 {
00695 INT idx = cdg->Idx ((CTRL_DEP *) cd);
00696
00697 return (*cdg)[idx].Get_ctrl_index ();
00698 }
00699
00700
00701 SUMMARY_STMT *
00702 Get_new_stmt (INT idx, BOOL branch, WN *w)
00703 {
00704 return (*cdg)[idx].Get_new_stmt (branch, w);
00705
00706 }
00707
00708
00709 SUMMARY_STMT *
00710 Get_last_stmt (INT idx, BOOL branch)
00711 {
00712 return (*cdg)[idx].Get_last_stmt (branch);
00713 }
00714
00715
00716
00717 SUMMARY_CONTROL_DEPENDENCE *
00718 Get_next_cd_chain (void)
00719 {
00720 iterator_idx++;
00721 while (iterator_idx < cdg->Elements ()) {
00722 if ((*cdg)[iterator_idx].Is_head_of_chain ())
00723 return (*cdg)[iterator_idx].Get_cd ();
00724 iterator_idx++;
00725 }
00726
00727 iterator_idx = -1;
00728 return NULL;
00729 }
00730
00731
00732
00733 SUMMARY_CONTROL_DEPENDENCE *
00734 Get_next_cd (void)
00735 {
00736 static INT idx = 0;
00737
00738 while (idx < cdg->Elements ())
00739 return (*cdg)[idx++].Get_cd ();
00740 idx = 0;
00741 return NULL;
00742 }
00743
00744
00745 SUMMARY_STMT *
00746 Get_summary_stmts (SUMMARY_CONTROL_DEPENDENCE *cd, BOOL branch)
00747 {
00748 INT idx = cdg->Idx ((CTRL_DEP *) cd);
00749
00750 if (branch == TRUE)
00751 return (*cdg)[idx].Get_true_stmts ();
00752 else
00753 return (*cdg)[idx].Get_false_stmts ();
00754 }
00755
00756
00757
00758
00759 SUMMARY_CONTROL_DEPENDENCE *
00760 Get_controlling_stmt (WN *stmt_node)
00761 {
00762 INT idx = WN_MAP32_Get (Stmt_Map, stmt_node) - 1;
00763
00764 if (idx < 0 || idx > cdg->Lastidx ())
00765 return NULL;
00766
00767 return (*cdg)[idx].Get_cd ();
00768 }
00769
00770
00771 SUMMARY_STMT *
00772 Search_for_summary_stmt (WN *stmt_node, BOOL &branch, INT &stmt_idx)
00773 {
00774 INT idx = WN_MAP32_Get (Stmt_Map, stmt_node) - 1;
00775
00776 if (idx < 0 || idx > cdg->Lastidx ())
00777 return NULL;
00778
00779 SUMMARY_CONTROL_DEPENDENCE *cd = (*cdg)[idx].Get_cd ();
00780
00781 INT count;
00782 if ((count = cd->Get_true_count ()) > 0) {
00783 WN **wn_array = (*cdg)[idx].Get_true_wns ();
00784 for (INT i = 0; i < count; i++)
00785 if (wn_array[i] == stmt_node) {
00786 branch = TRUE;
00787 stmt_idx = i;
00788 return (*cdg)[idx].Get_true_stmts () + i;
00789 }
00790 }
00791
00792 if ((count = cd->Get_false_count ()) > 0) {
00793 WN **wn_array = (*cdg)[idx].Get_false_wns ();
00794 for (INT i = 0; i < count; i++)
00795 if (wn_array[i] == stmt_node) {
00796 branch = FALSE;
00797 stmt_idx = i;
00798 return (*cdg)[idx].Get_false_stmts () + i;
00799 }
00800 }
00801
00802 return NULL;
00803
00804 }
00805
00806
00807
00808
00809
00810 SUMMARY_CONTROL_DEPENDENCE *
00811 Search_for_own_cd (WN *cond_stmt)
00812 {
00813 BOOL branch;
00814 INT stmt_idx;
00815
00816 SUMMARY_STMT *stmt = Search_for_summary_stmt (cond_stmt, branch, stmt_idx);
00817
00818 if (stmt == NULL || ! (stmt->Is_cond ()))
00819 return NULL;
00820
00821 return Get_cd_by_idx(stmt->Get_cond_index());
00822 }
00823
00824
00825 WN *
00826 Get_stmt_node (SUMMARY_CONTROL_DEPENDENCE *cd, BOOL branch, INT stmt_idx)
00827 {
00828 CTRL_DEP *ctrl = (CTRL_DEP *) cd;
00829
00830 if (branch) {
00831 if (stmt_idx >= cd->Get_true_count ())
00832 return NULL;
00833 else
00834 return ctrl->Get_true_wns()[stmt_idx];
00835 } else {
00836 if (stmt_idx >= cd->Get_false_count ())
00837 return NULL;
00838 else
00839 return ctrl->Get_false_wns()[stmt_idx];
00840 }
00841
00842 }
00843
00844
00845
00846 void
00847 Fix_phi_node_ctrl_dep_index (SUMMARY_PHI *phi, INT num)
00848 {
00849 for (INT i = 0; i < num; ++i) {
00850 INT idx = phi[i].Get_ctrl_dep_index (0);
00851 phi[i].Set_ctrl_dep_index (0, (*cdg)[idx].Get_ctrl_index ());
00852 idx = phi[i].Get_ctrl_dep_index (1);
00853 phi[i].Set_ctrl_dep_index (1, (*cdg)[idx].Get_ctrl_index ());
00854 }
00855 }
00856
00857
00858 SUMMARY_ENTRY_CACHE *entry_cache;
00859
00860 INT
00861 SUMMARY_ENTRY_CACHE::Lookup (SUMMARY_TYPE type, void *node) const
00862 {
00863 INT hash_value;
00864 struct hash_node *p;
00865 SUMMARY_VALUE *value;
00866 SUMMARY_EXPR *expr;
00867 SUMMARY_PHI *phi;
00868 SUMMARY_CHI *chi;
00869
00870 switch (type) {
00871 case SUM_VALUE:
00872 value = (SUMMARY_VALUE *) node;
00873 hash_value = hash (value->Get_int_const_value ());
00874 for (p = table[hash_value]; p; p = p->next) {
00875 if (p->_type == type && p->_idx <= Summary->Get_value_idx () &&
00876 memcmp (value, Summary->Get_value (p->_idx),
00877 sizeof(SUMMARY_VALUE)) == 0)
00878 return p->_idx;
00879 }
00880 break;
00881
00882 case SUM_EXPR:
00883 expr = (SUMMARY_EXPR *) node;
00884 hash_value = hash (expr->Get_const_value ());
00885 for (p = table[hash_value]; p; p = p->next) {
00886 if (p->_type == type && p->_idx <= Summary->Get_expr_idx () &&
00887 memcmp (expr, Summary->Get_expr (p->_idx),
00888 sizeof(SUMMARY_EXPR)) == 0)
00889 return p->_idx;
00890 }
00891 break;
00892
00893 case SUM_PHI:
00894 phi = (SUMMARY_PHI *) node;
00895 hash_value = hash (phi->Get_node_index (0) + phi->Get_node_index (1));
00896 for (p = table[hash_value]; p; p = p->next) {
00897 if (p->_type == type && p->_idx <= Summary->Get_phi_idx () &&
00898 memcmp (phi, Summary->Get_phi (p->_idx),
00899 sizeof(SUMMARY_PHI)) == 0)
00900 return p->_idx;
00901 }
00902 break;
00903
00904 case SUM_CHI:
00905 chi = (SUMMARY_CHI *) node;
00906 hash_value = hash (chi->Get_node_index ());
00907 for (p = table[hash_value]; p; p = p->next) {
00908 if (p->_type == type && p->_idx <= Summary->Get_chi_idx () &&
00909 memcmp (chi, Summary->Get_chi (p->_idx),
00910 sizeof(SUMMARY_CHI)) == 0)
00911 return p->_idx;
00912 }
00913 break;
00914 }
00915
00916 return -1;
00917 }
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927 static BOOL HasReturnPreg(WN *w, TY_IDX type) {
00928 TYPE_ID ty1, ty2;
00929 PREG_NUM reg1, reg2;
00930
00931 if (WHIRL_Return_Info_On) {
00932
00933 RETURN_INFO return_info = Get_Return_Info (type,
00934 Complex_Not_Simulated);
00935
00936 if (RETURN_INFO_count(return_info) <= 2) {
00937
00938 ty1 = RETURN_INFO_mtype (return_info, 0);
00939 ty2 = RETURN_INFO_mtype (return_info, 1);
00940 reg1 = RETURN_INFO_preg (return_info, 0);
00941 reg2 = RETURN_INFO_preg (return_info, 1);
00942 }
00943
00944 else
00945 Fail_FmtAssertion ("HasReturnPreg: more than 2 return registers");
00946 }
00947
00948 else {
00949 Get_Return_Mtypes(type, Complex_Not_Simulated, &ty1, &ty2);
00950 Get_Return_Pregs(ty1, ty2, ®1, ®2);
00951 }
00952 return ((WN_store_offset(w) == reg1) || (WN_store_offset(w) == reg2));
00953 }
00954
00955 BOOL
00956 IsStidToReturnPreg (WN *wn, WN* entry_point)
00957 {
00958 if (!WN_operator_is (wn, OPR_STID))
00959 return FALSE;
00960
00961 ST *st = wn ? WN_st(wn) : NULL;
00962 WN *wnkid = wn ? WN_kid0(wn) : NULL;
00963 if ((st == NULL) || (wnkid==NULL))
00964 return FALSE;
00965 TY_IDX tykid = WN_ty(wnkid);
00966 TY_IDX proctype = ST_pu_type(WN_entry_name(entry_point));
00967 TY_IDX returnty = Tylist_Table[TY_tylist (Ty_Table[proctype])];
00968 return ((ST_class(st) == CLASS_PREG) &&
00969 HasReturnPreg(wn,returnty) &&
00970 WN_operator_is(wnkid,OPR_LDID) && (!TY_is_volatile(tykid)));
00971 }
00972
00973
00974 INT GetChildIndex(WN *parent, WN* child) {
00975 INT pos = 0;
00976 while ((pos < WN_kid_count(parent)) && (WN_kid(parent,pos) != child))
00977 ++pos;
00978 return pos;
00979 }
00980
00981
00982 static void
00983 count_stats(WN *w, INT32& bbs, INT32& stmts, FB_FREQ& cycles, FB_FREQ freq)
00984 {
00985
00986 OPERATOR opr = OPCODE_operator(WN_opcode(w));
00987
00988 TYPE_ID rtype = OPCODE_rtype(WN_opcode(w));
00989
00990
00991 if (OPERATOR_is_non_scf(opr)) {
00992 ++bbs;
00993 if (freq.Known())
00994 cycles += freq;
00995 } else if (OPERATOR_is_stmt(opr)) {
00996 if (OPERATOR_is_call(opr)) {
00997 ++bbs;
00998 if (freq.Known())
00999 cycles += freq;
01000 } else if (opr == OPR_IO) {
01001 ++bbs;
01002 if (freq.Known())
01003 cycles += freq;
01004 } else if (! OPERATOR_is_not_executable(opr)) {
01005 ++stmts;
01006 if (freq.Known())
01007 cycles += freq;
01008 if (MTYPE_is_complex(rtype) && OPERATOR_is_store(opr)) {
01009 if (freq.Known())
01010 cycles += freq;
01011 ++stmts;
01012 }
01013 }
01014 } else if (OPERATOR_is_scf(opr)) {
01015 if (opr != OPR_BLOCK) {
01016
01017 ++bbs;
01018 if (freq.Known())
01019 cycles += freq;
01020 }
01021 } else if ((rtype == MTYPE_FQ || rtype == MTYPE_CQ) &&
01022 OPERATOR_is_expression(opr) &&
01023 !OPERATOR_is_load(opr) &&
01024 !OPERATOR_is_leaf(opr) ) {
01025
01026 ++bbs;
01027 if (freq.Known())
01028 cycles += freq;
01029 } else if (opr == OPR_CAND || opr == OPR_CIOR) {
01030
01031
01032
01033 ++bbs;
01034 if (freq.Known())
01035 cycles += freq;
01036 }
01037
01038 }
01039
01040
01041
01042 void
01043 Count_tree_size (FEEDBACK& fb, WN *wn, INT32 &bbs, INT32 &stmts, FB_FREQ& cycles, FB_FREQ &freq_count)
01044 {
01045 #if 0
01046 if (op != OPC_BLOCK && (OPCODE_is_scf (op) || OPCODE_is_stmt (op)))
01047 if (WN_MAP32_Get (WN_MAP_FEEDBACK, w) == 0)
01048 return;
01049 #endif
01050
01051 static BOOL init_invoke_seen = FALSE;
01052 static FB_FREQ init_invoke;
01053
01054 if (!init_invoke_seen)
01055 init_invoke = freq_count;
01056
01057 #if (defined(_STANDALONE_INLINER) || defined(_LIGHTWEIGHT_INLINER))
01058 BOOL IPL_Enable_Unknown_Frequency = FALSE;
01059 #endif // _STANDALONE_INLINER
01060
01061 if (!freq_count.Known()) {
01062 if (!IPL_Enable_Unknown_Frequency) {
01063 cycles = FB_FREQ_UNKNOWN;
01064 DevWarn ("Unknown frequency found in Count_tree_size, this should never happen");
01065 return;
01066 } else
01067 freq_count = init_invoke;
01068 }
01069
01070 if (wn) {
01071 WN * wn2;
01072
01073 switch (WN_operator(wn)) {
01074
01075 case OPR_BLOCK:
01076 wn2 = WN_first(wn);
01077 while (wn2) {
01078 Count_tree_size(fb, wn2, bbs, stmts, cycles, freq_count);
01079 wn2 = WN_next(wn2);
01080 }
01081 break;
01082
01083 case OPR_REGION:
01084 Count_tree_size(fb, WN_region_body(wn), bbs, stmts, cycles, freq_count);
01085 break;
01086
01087 case OPR_IF:
01088 {
01089 Count_tree_size(fb, WN_if_test(wn), bbs, stmts, cycles, freq_count);
01090 FB_Info_Branch info_branch = fb.Query_branch( wn );
01091 if (!info_branch.freq_taken.Known() ||
01092 !info_branch.freq_not_taken.Known()) {
01093 if (!IPL_Enable_Unknown_Frequency) {
01094 cycles = FB_FREQ_UNKNOWN;
01095 DevWarn ("Unknown frequency found in IF, this should never happen");
01096 return;
01097 } else {
01098 info_branch.freq_taken = init_invoke;
01099 info_branch.freq_not_taken = init_invoke;
01100 }
01101 }
01102
01103 if (WN_then(wn)) {
01104 Count_tree_size(fb, WN_then(wn), bbs, stmts, cycles, info_branch.freq_taken);
01105 }
01106 if (WN_else(wn)) {
01107 Count_tree_size(fb, WN_else(wn), bbs, stmts, cycles, info_branch.freq_not_taken);
01108 }
01109 break;
01110 }
01111
01112 case OPR_DO_LOOP:
01113 {
01114 FB_Info_Loop fb_info = fb.Query_loop( wn );
01115 if (!fb_info.freq_iterate.Known() ||
01116 !fb_info.freq_exit.Known()) {
01117 if (!IPL_Enable_Unknown_Frequency) {
01118 cycles = FB_FREQ_UNKNOWN;
01119 DevWarn ("Unknown frequency found in OPR_DO_LOOP, this should never happen");
01120 return;
01121 } else {
01122 fb_info.freq_iterate = init_invoke;
01123 fb_info.freq_exit = init_invoke;
01124 }
01125 }
01126 Count_tree_size(fb, WN_start(wn), bbs, stmts, cycles, freq_count);
01127 Count_tree_size(fb, WN_step(wn), bbs, stmts, cycles, freq_count);
01128 Count_tree_size(fb, WN_end(wn), bbs, stmts, cycles, freq_count);
01129 Count_tree_size(fb, WN_do_body(wn), bbs, stmts, cycles, fb_info.freq_iterate);
01130 freq_count = fb_info.freq_exit;
01131 break;
01132 }
01133
01134 case OPR_WHILE_DO:
01135 case OPR_DO_WHILE:
01136 {
01137 Count_tree_size(fb, WN_while_test(wn), bbs, stmts, cycles, freq_count);
01138 FB_Info_Loop fb_info = fb.Query_loop( wn );
01139 if (!fb_info.freq_iterate.Known() ||
01140 !fb_info.freq_exit.Known()) {
01141 if (!IPL_Enable_Unknown_Frequency) {
01142 cycles = FB_FREQ_UNKNOWN;
01143 DevWarn ("Unknown frequency found in OPR_WHILE_DO/OPR_DO_WHILE, this should never happen");
01144 return;
01145 } else {
01146 fb_info.freq_iterate = init_invoke;
01147 fb_info.freq_exit = init_invoke;
01148 }
01149 }
01150 Count_tree_size(fb, WN_while_body(wn), bbs, stmts, cycles, fb_info.freq_iterate);
01151 freq_count = fb_info.freq_exit;
01152 break;
01153 }
01154
01155 case OPR_SWITCH:
01156 case OPR_COMPGOTO:
01157 case OPR_XGOTO:
01158 {
01159 FB_Info_Switch fb_info = fb.Query_switch( wn );
01160 WN *targ_blk = WN_kid1(wn);
01161 wn2 = WN_first(targ_blk);
01162 INT t = WN_num_entries(wn) - 1;
01163 for ( ; t >= 0; --t, wn2 = WN_next(wn2) ) {
01164 if (!fb_info[t].Known()) {
01165 if (!IPL_Enable_Unknown_Frequency) {
01166 cycles = FB_FREQ_UNKNOWN;
01167 DevWarn ("Unknown frequency found in OPR_SWITCH/OPR_COMPGOTO/OPR_XGOTO, this should never happen");
01168 return;
01169 } else
01170 fb_info[t] = init_invoke;
01171 }
01172
01173 Count_tree_size(fb, wn2, bbs, stmts, cycles, fb_info[t]);
01174 }
01175 break;
01176 }
01177
01178 case OPR_LABEL:
01179 {
01180 FB_Info_Invoke info_invoke = fb.Query_invoke( wn );
01181 if (!info_invoke.freq_invoke.Known()) {
01182 if (!IPL_Enable_Unknown_Frequency) {
01183 cycles = FB_FREQ_UNKNOWN;
01184 DevWarn ("Unknown frequency found in OPR_LABEL, this should never happen");
01185 return;
01186 } else
01187 info_invoke.freq_invoke = init_invoke;
01188 }
01189
01190 freq_count = info_invoke.freq_invoke;
01191 break;
01192 }
01193
01194 default:
01195 {
01196 INT i;
01197 for (i = 0; i < WN_kid_count(wn); i++) {
01198 wn2 = WN_kid(wn,i);
01199 if (wn2) {
01200 Count_tree_size(fb, wn2, bbs, stmts, cycles, freq_count);
01201 }
01202 }
01203 }
01204 }
01205
01206 count_stats (wn, bbs, stmts, cycles, freq_count);
01207 }
01208
01209 }
01210
01211
01212 static void
01213 count_stats_tuning(WN *w, INT32& bbs, INT32& stmts, FB_FREQ& cycles, FB_FREQ freq, UINT32 &WNs, FB_FREQ &cycle_tuning)
01214 {
01215
01216 OPERATOR opr = OPCODE_operator(WN_opcode(w));
01217
01218 TYPE_ID rtype = OPCODE_rtype(WN_opcode(w));
01219
01220 if(freq.Known())
01221 cycle_tuning += freq;
01222
01223
01224 if (OPERATOR_is_non_scf(opr)) {
01225 ++bbs;
01226 if (freq.Known())
01227 cycles += freq;
01228 } else if (OPERATOR_is_stmt(opr)) {
01229 if (OPERATOR_is_call(opr)) {
01230 ++bbs;
01231 if (freq.Known())
01232 cycles += freq;
01233 } else if (opr == OPR_IO) {
01234 ++bbs;
01235 if (freq.Known())
01236 cycles += freq;
01237 } else if (! OPERATOR_is_not_executable(opr)) {
01238 ++stmts;
01239 if (freq.Known())
01240 cycles += freq;
01241 if (MTYPE_is_complex(rtype) && OPERATOR_is_store(opr)) {
01242 if (freq.Known())
01243 cycles += freq;
01244 ++stmts;
01245 }
01246 }
01247 } else if (OPERATOR_is_scf(opr)) {
01248 if (opr != OPR_BLOCK) {
01249
01250 ++bbs;
01251 if (freq.Known())
01252 cycles += freq;
01253 }
01254 } else if ((rtype == MTYPE_FQ || rtype == MTYPE_CQ) &&
01255 OPERATOR_is_expression(opr) &&
01256 !OPERATOR_is_load(opr) &&
01257 !OPERATOR_is_leaf(opr) ) {
01258
01259 ++bbs;
01260 if (freq.Known())
01261 cycles += freq;
01262 } else if (opr == OPR_CAND || opr == OPR_CIOR) {
01263
01264
01265
01266 ++bbs;
01267 if (freq.Known())
01268 cycles += freq;
01269 }
01270
01271 }
01272
01273
01274
01275 void
01276 Count_tree_size_tuning (FEEDBACK& fb, WN *wn, INT32 &bbs, INT32 &stmts, FB_FREQ& cycles, FB_FREQ &freq_count, UINT16 &WNs, FB_FREQ &cycle_tuning )
01277 {
01278 #if 0
01279 if (op != OPC_BLOCK && (OPCODE_is_scf (op) || OPCODE_is_stmt (op)))
01280 if (WN_MAP32_Get (WN_MAP_FEEDBACK, w) == 0)
01281 return;
01282 #endif
01283
01284 static BOOL init_invoke_seen = FALSE;
01285 static FB_FREQ init_invoke;
01286
01287 if (!init_invoke_seen)
01288 init_invoke = freq_count;
01289
01290 #if (defined(_STANDALONE_INLINER) || defined(_LIGHTWEIGHT_INLINER))
01291 BOOL IPL_Enable_Unknown_Frequency = FALSE;
01292 #endif // _STANDALONE_INLINER
01293
01294 if (!freq_count.Known()) {
01295 if (!IPL_Enable_Unknown_Frequency) {
01296 cycles = FB_FREQ_UNKNOWN;
01297 cycle_tuning = FB_FREQ_UNKNOWN;
01298 DevWarn ("Unknown frequency found in Count_tree_size_tuning, this should never happen");
01299 return;
01300 } else
01301 freq_count = init_invoke;
01302 }
01303
01304 if (wn) {
01305 WN * wn2;
01306
01307 WNs++;
01308 if(freq_count.Known())
01309 cycle_tuning += freq_count;
01310
01311 switch (WN_operator(wn)) {
01312
01313 case OPR_BLOCK:
01314 wn2 = WN_first(wn);
01315 while (wn2) {
01316 Count_tree_size_tuning(fb, wn2, bbs, stmts, cycles, freq_count, WNs, cycle_tuning);
01317 wn2 = WN_next(wn2);
01318 }
01319 break;
01320
01321 case OPR_REGION:
01322 Count_tree_size_tuning(fb, WN_region_body(wn), bbs, stmts, cycles, freq_count, WNs, cycle_tuning);
01323 break;
01324
01325 case OPR_IF:
01326 {
01327 Count_tree_size_tuning(fb, WN_if_test(wn), bbs, stmts, cycles, freq_count, WNs, cycle_tuning);
01328 FB_Info_Branch info_branch = fb.Query_branch( wn );
01329 if (!info_branch.freq_taken.Known() ||
01330 !info_branch.freq_not_taken.Known()) {
01331 if (!IPL_Enable_Unknown_Frequency) {
01332 cycles = FB_FREQ_UNKNOWN;
01333 cycle_tuning = FB_FREQ_UNKNOWN;
01334 DevWarn ("Unknown frequency found in IF, this should never happen");
01335 return;
01336 } else {
01337 info_branch.freq_taken = init_invoke;
01338 info_branch.freq_not_taken = init_invoke;
01339 }
01340 }
01341
01342 if (WN_then(wn)) {
01343 Count_tree_size_tuning(fb, WN_then(wn), bbs, stmts, cycles, info_branch.freq_taken, WNs, cycle_tuning);
01344 }
01345 if (WN_else(wn)) {
01346 Count_tree_size_tuning(fb, WN_else(wn), bbs, stmts, cycles, info_branch.freq_not_taken, WNs, cycle_tuning);
01347 }
01348 break;
01349 }
01350
01351 case OPR_DO_LOOP:
01352 {
01353 FB_Info_Loop fb_info = fb.Query_loop( wn );
01354 if (!fb_info.freq_iterate.Known() ||
01355 !fb_info.freq_exit.Known()) {
01356 if (!IPL_Enable_Unknown_Frequency) {
01357 cycles = FB_FREQ_UNKNOWN;
01358 cycle_tuning = FB_FREQ_UNKNOWN;
01359 DevWarn ("Unknown frequency found in OPR_DO_LOOP, this should never happen");
01360 return;
01361 } else {
01362 fb_info.freq_iterate = init_invoke;
01363 fb_info.freq_exit = init_invoke;
01364 }
01365 }
01366 Count_tree_size_tuning(fb, WN_start(wn), bbs, stmts, cycles, freq_count, WNs, cycle_tuning);
01367 Count_tree_size_tuning(fb, WN_step(wn), bbs, stmts, cycles, freq_count, WNs, cycle_tuning);
01368 Count_tree_size_tuning(fb, WN_end(wn), bbs, stmts, cycles, freq_count, WNs, cycle_tuning);
01369 Count_tree_size_tuning(fb, WN_do_body(wn), bbs, stmts, cycles, fb_info.freq_iterate, WNs, cycle_tuning);
01370 freq_count = fb_info.freq_exit;
01371 break;
01372 }
01373
01374 case OPR_WHILE_DO:
01375 case OPR_DO_WHILE:
01376 {
01377 Count_tree_size_tuning(fb, WN_while_test(wn), bbs, stmts, cycles, freq_count, WNs, cycle_tuning);
01378 FB_Info_Loop fb_info = fb.Query_loop( wn );
01379 if (!fb_info.freq_iterate.Known() ||
01380 !fb_info.freq_exit.Known()) {
01381 if (!IPL_Enable_Unknown_Frequency) {
01382 cycles = FB_FREQ_UNKNOWN;
01383 cycle_tuning = FB_FREQ_UNKNOWN;
01384 cycle_tuning = FB_FREQ_UNKNOWN;
01385 DevWarn ("Unknown frequency found in OPR_WHILE_DO/OPR_DO_WHILE, this should never happen");
01386 return;
01387 } else {
01388 fb_info.freq_iterate = init_invoke;
01389 fb_info.freq_exit = init_invoke;
01390 }
01391 }
01392 Count_tree_size_tuning(fb, WN_while_body(wn), bbs, stmts, cycles, fb_info.freq_iterate, WNs, cycle_tuning);
01393 freq_count = fb_info.freq_exit;
01394 break;
01395 }
01396
01397 case OPR_SWITCH:
01398 case OPR_COMPGOTO:
01399 case OPR_XGOTO:
01400 {
01401 FB_Info_Switch fb_info = fb.Query_switch( wn );
01402 WN *targ_blk = WN_kid1(wn);
01403 wn2 = WN_first(targ_blk);
01404 INT t = WN_num_entries(wn) - 1;
01405 for ( ; t >= 0; --t, wn2 = WN_next(wn2) ) {
01406 if (!fb_info[t].Known()) {
01407 if (!IPL_Enable_Unknown_Frequency) {
01408 cycles = FB_FREQ_UNKNOWN;
01409 cycle_tuning = FB_FREQ_UNKNOWN;
01410 DevWarn ("Unknown frequency found in OPR_SWITCH/OPR_COMPGOTO/OPR_XGOTO, this should never happen");
01411 return;
01412 } else
01413 fb_info[t] = init_invoke;
01414 }
01415
01416 Count_tree_size_tuning(fb, wn2, bbs, stmts, cycles, fb_info[t], WNs, cycle_tuning);
01417 }
01418 break;
01419 }
01420
01421 case OPR_LABEL:
01422 {
01423 FB_Info_Invoke info_invoke = fb.Query_invoke( wn );
01424 if (!info_invoke.freq_invoke.Known()) {
01425 if (!IPL_Enable_Unknown_Frequency) {
01426 cycles = FB_FREQ_UNKNOWN;
01427 cycle_tuning = FB_FREQ_UNKNOWN;
01428 DevWarn ("Unknown frequency found in OPR_LABEL, this should never happen");
01429 return;
01430 } else
01431 info_invoke.freq_invoke = init_invoke;
01432 }
01433
01434 freq_count = info_invoke.freq_invoke;
01435 break;
01436 }
01437
01438 default:
01439 {
01440 INT i;
01441 for (i = 0; i < WN_kid_count(wn); i++)
01442 {
01443 wn2 = WN_kid(wn,i);
01444 if (wn2)
01445 {
01446 Count_tree_size_tuning(fb, wn2, bbs, stmts, cycles, freq_count, WNs, cycle_tuning);
01447 }
01448 }
01449 }
01450 }
01451
01452 count_stats (wn, bbs, stmts, cycles, freq_count);
01453
01454 }
01455
01456 }
01457
01458