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 #include <elf.h>
00059 #include <sys/elf_whirl.h>
00060 #include <sys/types.h>
00061
00062 #include "defs.h"
00063 #include "ipa_section.h"
00064 #include "ipl_summary.h"
00065
00066
00067
00068 #ifndef IPA_SUMMARY
00069
00070 #if !(defined(linux) || defined(BUILD_OS_DARWIN))
00071 #include "ipc_file.h"
00072 #include "ipc_symtab_merge.h"
00073 #include "ipo_defs.h"
00074 #include "ipa_section_main.h"
00075
00076
00077
00078 static SUMMARY_SYMBOL* IPA_Symbol = NULL;
00079 #endif
00080
00081 #if !(defined(linux) || defined(BUILD_OS_DARWIN))
00082 void
00083 Init_IPA_Print_Arrays (IPA_NODE* node)
00084 {
00085 IPA_Symbol = IPA_get_symbol_array (node);
00086 IPA_get_ivar_array (node, IPA_Ivar_Count);
00087 }
00088
00089 static char*
00090 Symbol_Name(SUMMARY_SYMBOL* ss)
00091 {
00092 if (ST_IDX_level(ss->St_idx()) > GLOBAL_SYMTAB) {
00093 ST_IDX func_st_idx = ss->Get_st_idx_func();
00094 PU_IDX pu_idx = ST_pu(&St_Table[func_st_idx]);
00095 NODE_INDEX node_index = AUX_PU_node(Aux_Pu_Table[pu_idx]);
00096 IPA_NODE* cnode = IPA_Call_Graph->Graph()->Node_User(node_index);
00097 IPA_NODE_CONTEXT context(cnode);
00098 return ST_name(ss->St_idx());
00099 }
00100 else {
00101 return ST_name(St_Table[ss->St_idx()]);
00102 }
00103 }
00104
00105 #else
00106
00107 #include "ipl_summarize.h"
00108
00109 extern SUMMARY *Summary;
00110 extern IVAR_ARRAY *Ivar;
00111
00112 #endif
00113
00114
00115
00116
00117 void LOOPINFO::Print_file(FILE *fp)
00118 {
00119 if (Is_messy_ub())
00120 fprintf(fp, "messy upper, ");
00121 else
00122 fprintf(fp, "not messy upper, ");
00123
00124 if (Is_messy_lb())
00125 fprintf(fp, "messy lower, ");
00126 else
00127 fprintf(fp, "not messy lower, ");
00128
00129 if (Is_messy_step())
00130 fprintf(fp, "messy step, ");
00131 else
00132 fprintf(fp, "not messy step, ");
00133
00134 if (Is_messy_bounds())
00135 fprintf(fp, "messy bounds \n");
00136
00137 fprintf(fp, "nest-level = %d \n", Get_nest_level());
00138
00139 fprintf(fp, "Lower bound terms: term array index = %d , count = %d \n",
00140 Get_lb_term_index(), Get_lb_term_count());
00141
00142 fprintf(fp, "Upper bound terms: term array index = %d , count = %d \n",
00143 Get_ub_term_index(), Get_ub_term_count());
00144
00145 fprintf(fp, "Step bound terms: term array index = %d , count = %d \n",
00146 Get_step_term_index(), Get_step_term_count());
00147
00148 }
00149
00150
00151
00152
00153
00154 void
00155 REGION_ARRAYS::Print_file(FILE* fp)
00156 {
00157 if (Is_bad_alias())
00158 fprintf(fp, "Has bad alias, ");
00159 if (Is_loop_invariant())
00160 fprintf(fp, "Is loop invariant, ");
00161 if (Is_use())
00162 fprintf(fp, "Is_use, ");
00163 else if (Is_def())
00164 fprintf(fp, "Is_def, ");
00165 else if (Is_passed())
00166 fprintf(fp, "Is_passed, ");
00167 else if (Is_may_def())
00168 fprintf(fp, "Is_may_def, ");
00169 else if (Is_may_use())
00170 fprintf(fp, "Is_may_use, ");
00171 else if (Is_formal())
00172 fprintf(fp, "Is_formal, ");
00173 else
00174 fprintf(fp, "UNKNOWN type. ");
00175
00176 fprintf(fp, "\nSymbol id = %d \n", _sym_index);
00177 fprintf(fp, "Element size = %d \n", _element_size);
00178
00179 fprintf(fp, "Id into PROJECTED_REGION_ARRAY = %d, count = %d \n",
00180 Get_idx(), Get_count());
00181 }
00182
00183
00184
00185
00186
00187 void
00188 PROJECTED_NODE::Print_file(FILE *fp)
00189 {
00190 fprintf(fp, "%smessy lower, ", Is_messy_lb() ? "" : "non-");
00191 fprintf(fp, "%smessy upper, ", Is_messy_ub() ? "" : "non-");
00192 fprintf(fp, "%smessy step, ", Is_messy_step() ? "" : "non-");
00193 fprintf(fp, "%sprojected", Is_unprojected() ? "NOT" : "");
00194 if (Is_assumed_shape())
00195 fprintf(fp, ", assumed_shape");
00196 fprintf(fp, "\n terms in lower: idx = %d, count = %d\n",
00197 Get_lb_term_index(), Get_lb_term_count());
00198 fprintf(fp, " terms in upper: idx = %d, count = %d\n",
00199 Get_ub_term_index(), Get_ub_term_count());
00200 fprintf(fp, " terms in step: idx = %d, count = %d \n",
00201 Get_step_term_index(), Get_step_term_count());
00202 if (Get_segment_length_term_count() > 0)
00203 fprintf(fp, " terms in segment length: idx = %d, count = %d\n",
00204 Get_segment_length_term_index(), Get_segment_length_term_count());
00205 if (Get_segment_stride_term_count() > 0)
00206 fprintf(fp, " terms in segment stride: idx = %d, count = %d\n",
00207 Get_segment_stride_term_index(), Get_segment_stride_term_count());
00208 }
00209
00210
00211
00212
00213
00214 void
00215 CFG_NODE_INFO::Print_file(FILE *fp)
00216 {
00217 if (Is_do_loop()) {
00218 fprintf(fp, "TYPE: CFG_DO_LOOP, loopinfo index = %d", Get_loop_index());
00219 if (Is_executed()) {
00220 fprintf(fp, "ALWAYS executed");
00221 }
00222 fprintf(fp, "\n");
00223 }
00224 else if (Is_if()) {
00225 fprintf(fp, "TYPE: CFG_IF\n");
00226 fprintf(fp, "ELSE cfg node index = %d \n", Get_else_index());
00227 }
00228 else if (Is_else()) {
00229 fprintf(fp, "TYPE: CFG_ELSE \n");
00230 fprintf(fp, "IF cfg node index = %d \n", Get_if_index());
00231 }
00232 else if (Is_entry()) {
00233 fprintf(fp, "TYPE: CFG_ENTRY \n");
00234 }
00235 else {
00236 fprintf(fp, "TYPE: UNKNOWN \n");
00237 }
00238
00239 fprintf(fp, "Control Dependence Index: %d\n", Get_cd_index());
00240
00241 if (Has_calls()) {
00242 fprintf(fp, "Has calls \n");
00243 }
00244
00245
00246 fprintf(fp,"array kills: offset into REGIONS_ARRAY = %d, count = %d\n",
00247 Get_def_index(), Get_def_count());
00248
00249
00250 fprintf(fp, "array uses: offset into REGIONS_ARRAY = %d, count = %d\n",
00251 Get_use_index(), Get_use_count());
00252
00253
00254 fprintf(fp,"array params: offset into REGIONS_ARRAY = %d, count = %d\n",
00255 Get_param_index(), Get_param_count());
00256
00257
00258 fprintf(fp,"array formals: offset into REGIONS_ARRAY = %d, count = %d\n",
00259 Get_formal_index(), Get_formal_count());
00260
00261
00262 fprintf(fp, "scalar info: offset into INT_ARRAY = %d, count = %d \n",
00263 Get_scalar_index(), Get_scalar_count());
00264 }
00265
00266
00267
00268
00269
00270 void
00271 PROJECTED_REGION::Print_file(FILE *fp)
00272 {
00273 if (Is_messy_region())
00274 fputs("messy region", fp);
00275 else
00276 fputs("non-messy region", fp);
00277
00278 if (Is_unprojected_region())
00279 fputs(", unprojected region, ", fp);
00280 else
00281 fputs(", projected region, ", fp);
00282
00283 fprintf(fp, "num dims = %d, depth = %d \n", Get_num_dims(), Get_depth());
00284
00285 if (Is_passed())
00286 fprintf(fp, "parameter array section, callsite_id = %d, actual_pos = %d\n",
00287 Get_callsite_id(), Get_actual_id());
00288
00289 fprintf(fp, "id into projected node array = %d \n", Get_id());
00290 }
00291
00292
00293
00294
00295 void
00296 LINEX::Print_file(FILE* fp)
00297 {
00298 for (INT i = 0; i < _larray.Elements(); ++i) {
00299 _larray[i].Print_file(fp);
00300 }
00301 }
00302
00303
00304
00305
00306 void
00307 LINEX::Print(FILE *fp)
00308 {
00309 #ifdef IPA_SUMMARY
00310 if (Trace_Sections) {
00311 if (_larray.Lastidx() == -1) {
00312 fprintf(TFile, "NULL linex \n");
00313 fprintf(stdout, "NULL linex \n");
00314 }
00315 }
00316 #endif
00317 for (INT i = 0; i <= _larray.Lastidx(); ++i) {
00318 _larray[i].Print(fp, FALSE);
00319 if (i < _larray.Lastidx()) {
00320 fprintf(fp, "+");
00321 }
00322 }
00323 }
00324
00325
00326
00327
00328
00329 void
00330 IVAR::Print (FILE* fp)
00331 {
00332 fprintf(fp, "IVAR: ");
00333 if (Is_Formal()) {
00334 fprintf(fp, "FORMAL_POSITION = %d, OFFSET = %d, MTYPE = %s\n",
00335 Formal_Position(), Offset(), Machine_Types[Mtype()].name);
00336 }
00337 else {
00338 fprintf(fp, "GLOBAL %s, OFFSET = %d, MTYPE = %s\n",
00339 ST_name(St_Idx()), Offset(), Machine_Types[Mtype()].name);
00340 }
00341 }
00342 #endif
00343
00344
00345
00346
00347
00348
00349
00350 void IVAR::IPA_LNO_Print_File(FILE* fp, INT ivar_index)
00351 {
00352 fprintf(fp, "IVAR");
00353 if (ivar_index == -1) {
00354 fprintf(fp, ":");
00355 }
00356 else {
00357 fprintf(fp, "[%d]:", ivar_index);
00358 }
00359 if (Is_Formal()) {
00360 fprintf(fp, "FORMAL_POSITION = %d, OFFSET = %d, MTYPE = %s\n",
00361 Formal_Position(), Offset(), Machine_Types[Mtype()].name);
00362 }
00363 else {
00364 fprintf(fp, "GLOBAL %s, OFFSET = %d, MTYPE = %s\n",
00365 ST_name(St_Idx()), Offset(), Machine_Types[Mtype()].name);
00366 }
00367 }
00368
00369
00370
00371
00372 void
00373 TERM::Print(FILE *fp, BOOL newline)
00374 {
00375 switch (Get_type()) {
00376
00377 case LTKIND_NONE:
00378 fprintf(fp,"?");
00379 break;
00380
00381 case LTKIND_CONST:
00382 fprintf(fp,"%d", Get_coeff());
00383 break;
00384
00385 case LTKIND_LINDEX:
00386 fprintf(fp,"loop_index(%d)*%d", Get_desc(), Get_coeff());
00387 break;
00388
00389 case LTKIND_SUBSCR:
00390 fprintf(fp,"dim(%d)*%d", Get_desc(), Get_coeff());
00391 break;
00392
00393 case LTKIND_IV:
00394 fprintf(fp,"IVAR[%d]*%d", Get_desc(), Get_coeff());
00395 break;
00396 }
00397
00398 if (newline) {
00399 fprintf(fp, "\n");
00400 }
00401 }
00402
00403
00404
00405
00406 void
00407 TERM::Print_file (FILE* fp)
00408 {
00409 switch (Get_type())
00410 {
00411 case LTKIND_NONE:
00412 fprintf(fp,"unknown TERM\n");
00413 break;
00414
00415 case LTKIND_CONST:
00416 fprintf(fp,"CONST:+ %d\n", Get_coeff());
00417 break;
00418
00419 case LTKIND_LINDEX:
00420 fprintf(fp,"LINDEX: + loop_index(%d)*%d\n", Get_desc(), Get_coeff());
00421 break;
00422
00423 case LTKIND_SUBSCR:
00424 fprintf(fp,"SUBSCR: + dim(%d)*%d\n", Get_desc(), Get_coeff());
00425 break;
00426
00427 case LTKIND_IV:
00428 fprintf(fp,"IVAR: + IVAR[%d]*%d\n", Get_desc(), Get_coeff());
00429 break;
00430
00431 default:
00432 fprintf(fp, "UNKNOWN TYPE:%d something is wrong\n", Get_type());
00433 break;
00434 }
00435 }
00436
00437
00438
00439
00440
00441
00442
00443
00444 void TERM::IPA_LNO_Print_File(FILE* fp,
00445 INT term_index)
00446 {
00447 if (term_index == -1)
00448 fprintf(fp, "TERM: ");
00449 else
00450 fprintf(fp, "TERM[%d]: ", term_index);
00451 switch (Get_type()) {
00452 case LTKIND_NONE:
00453 fprintf(fp, "NONE ");
00454 break;
00455 case LTKIND_CONST:
00456 fprintf(fp, "CONST(%d)", Get_coeff());
00457 break;
00458 case LTKIND_LINDEX:
00459 fprintf(fp, "LINDEX(%d) * (%d) ", Get_desc(), Get_coeff());
00460 break;
00461 case LTKIND_SUBSCR:
00462 fprintf(fp, "SUBSCR(%d) * (%d) ", Get_desc(), Get_coeff());
00463 break;
00464 case LTKIND_IV:
00465 fprintf(fp, "IVAR[%d] * (%d) ", Get_desc(), Get_coeff());
00466 break;
00467 default:
00468 fprintf(fp, " ");
00469 break;
00470 }
00471 fprintf(fp, "\n");
00472 }
00473
00474 #if !(defined(linux) || defined(BUILD_OS_DARWIN))
00475
00476
00477
00478 void
00479 SCALAR_INFO::Print_file(FILE *fp)
00480 {
00481 fprintf(fp, "SCALAR_INFO: ");
00482 fprintf(fp, "id:%d, call_id:%d, TYPE: ", Get_id(), Get_callsite_id());
00483 if (Is_may_kill())
00484 fprintf(fp, "may kill: ");
00485 if (Is_may_use())
00486 fprintf(fp, "may use: ");
00487 if (Is_may_reduc())
00488 fprintf(fp, "may reduc: ");
00489 if (Is_kill())
00490 fprintf(fp, "kill: ");
00491 if (Is_use())
00492 fprintf(fp, "use: ");
00493 if (Is_euse())
00494 fprintf(fp, "euse: ");
00495 if (Is_call_euse())
00496 fprintf(fp, "call euse: ");
00497 if (Is_reduc())
00498 fprintf(fp, "reduc: ");
00499 if (Is_array_reduc())
00500 fprintf(fp, "array reduc: ");
00501 if (Is_array_may_reduc())
00502 fprintf(fp, "may array reduc: ");
00503 if (Is_passed_ref())
00504 fprintf(fp, "passed ref: ");
00505 if (Is_may_passed_ref())
00506 fprintf(fp, "may passed ref: ");
00507 fprintf(fp, "\n");
00508 }
00509 #endif
00510
00511
00512
00513
00514 void PROJECTED_KERNEL::Print(FILE *fp)
00515 {
00516 INT i;
00517
00518 fprintf(fp, "+++++PROJECTED_KERNEL_START+++++\n");
00519
00520 if (Is_messy_kernel())
00521 fprintf(fp, "messy, ");
00522 else
00523 fprintf(fp, "non-messy, ");
00524
00525 if (Is_projected())
00526 fprintf(fp, "projected, ");
00527 else
00528 fprintf(fp, "unprojected, ");
00529
00530 fprintf(fp, "num dims = %d, ", Get_num_dims());
00531 fprintf(fp, "depth = %d, ", Get_depth());
00532 fprintf(fp, "proj level = %d ", Get_projected_level());
00533 fprintf(fp, "\n");
00534
00535
00536 fprintf(fp, "is_independent = [");
00537 for (i = 0; i < Get_depth(); i++) {
00538 if (Is_independent(i))
00539 fprintf(fp, "TRUE");
00540 else
00541 fprintf(fp, "FALSE");
00542 if (i < Get_depth() - 1)
00543 fprintf(fp, ",");
00544 }
00545 fprintf(fp, "]\n");
00546 for (i=0; i < Get_num_dims(); ++i) {
00547 LINEX *l;
00548 if (l = Get_linex(i)) {
00549 fprintf(fp, "input_linex[%d] = ", i);
00550 l->Print(fp);
00551 fprintf(fp, "\n");
00552 }
00553 }
00554 if (Get_region() != NULL)
00555 fprintf(fp, "region = 0x%lx\n", Get_region());
00556 for (i = 0; i < Get_num_dims(); i++) {
00557 LINEX *l;
00558 if (l = Get_Difference(i)) {
00559 fprintf(fp, "difference[%d] = ", i);
00560 l->Print(fp);
00561 fprintf(fp, "\n");
00562 }
00563 }
00564 fprintf(fp, "+++++PROJECTED_KERNEL_FINISHED+++++\n");
00565 }
00566
00567
00568
00569
00570 void LOOPINFO::Print(FILE *fp)
00571 {
00572 LINEX *l;
00573 INT i;
00574
00575 fprintf(fp, "\n+++++LOOPINFO_START+++++\n");
00576 if (Is_messy_ub())
00577 fprintf(fp, "messy upper, ");
00578 else
00579 fprintf(fp, "not messy upper, ");
00580
00581 if (Is_messy_lb())
00582 fprintf(fp, "messy lower, ");
00583 else
00584 fprintf(fp, "not messy lower, ");
00585
00586 if (Is_messy_step())
00587 fprintf(fp, "messy step, ");
00588 else
00589 fprintf(fp, "not messy step, ");
00590
00591 if (Is_messy_bounds())
00592 fprintf(fp, "messy bounds \n");
00593
00594 fprintf(fp, "nest-level = %d\n", Get_nest_level());
00595
00596 l = Get_lower_linex();
00597 if (l)
00598 {
00599 fprintf(fp, "\n Lower bound linex \n");
00600 l->Print(fp);
00601 }
00602 else
00603 fprintf(fp, "\n NULL lower bound linex \n");
00604
00605
00606 l = Get_upper_linex();
00607 if (l)
00608 {
00609 fprintf(fp, "\n Upper bound linex \n");
00610 l->Print(fp);
00611 }
00612 else
00613 fprintf(fp, "\n NULL upper bound linex \n");
00614
00615
00616 l = Get_step_linex();
00617 if (l)
00618 {
00619 fprintf(fp, "\n Step linex \n");
00620 l->Print(fp);
00621 }
00622 else
00623 fprintf(fp, "\n NULL step linex \n");
00624
00625 if (Get_kernels() != NULL)
00626 {
00627 PROJECTED_KERNEL_ARRAY *k = Get_kernels();
00628 for (i=0; i<k->Lastidx();++i)
00629 {
00630 PROJECTED_KERNEL* kernel = &(*k)[i];
00631 kernel->Print(fp);
00632 }
00633 }
00634
00635 fprintf(fp, "+++++LOOPINFO_FINISHED+++++\n");
00636 }
00637
00638
00639
00640
00641 void PROJECTED_NODE::Print(FILE* fp)
00642 {
00643 LINEX* l;
00644
00645 fprintf(fp, "[");
00646
00647 if (Is_messy_lb()) {
00648 fprintf(fp, "messy");
00649 }
00650 else if (l = Get_lower_linex()) {
00651 l->Print(fp);
00652 }
00653 else {
00654 fprintf(fp, "?");
00655 }
00656
00657 fprintf(fp, ":");
00658
00659 if (Is_messy_ub()) {
00660 fprintf(fp, "messy");
00661 }
00662 else if (l = Get_upper_linex()) {
00663 l->Print(fp);
00664 }
00665 else {
00666 fprintf(fp, "?");
00667 }
00668
00669 fprintf(fp, ":");
00670
00671 if (Is_messy_step()) {
00672 fprintf(fp, "messy");
00673 }
00674 else if (l = Get_step_linex()) {
00675 l->Print(fp);
00676 }
00677 else {
00678 fprintf(fp, "?");
00679 }
00680
00681 if (Get_segment_length_linex() && Get_segment_stride_linex()) {
00682 fprintf(fp, ":");
00683 Get_segment_length_linex()->Print(fp);
00684 fprintf(fp, ":");
00685 Get_segment_stride_linex()->Print(fp);
00686 }
00687
00688 fprintf(fp, "]");
00689 fflush(fp);
00690 }
00691
00692
00693
00694
00695
00696
00697
00698 void PROJECTED_NODE::IPA_LNO_Print_File(FILE* fp,
00699 INT pn_index)
00700 {
00701 if (pn_index == -1)
00702 fprintf(fp, "PROJ_NODE: ");
00703 else
00704 fprintf(fp, "PROJ_NODE[%d]: ", pn_index);
00705 if (Is_unprojected()) {
00706 fprintf(fp, "<UNPROJECTED> TERM[%d:%d] ",
00707 Get_lb_term_index(), Get_lb_term_count());
00708 } else {
00709 if (Is_messy_lb())
00710 fprintf(fp, "LB <MESSY> ");
00711 else
00712 fprintf(fp, "LB TERM[%d:%d] ", Get_lb_term_index(),
00713 Get_lb_term_count());
00714 if (Is_messy_ub())
00715 fprintf(fp, "UB <MESSY> ");
00716 else
00717 fprintf(fp, "UB TERM[%d:%d] ", Get_ub_term_index(),
00718 Get_ub_term_count());
00719 if (Is_messy_step())
00720 fprintf(fp, "STEP <MESSY> ");
00721 else
00722 fprintf(fp, "STEP TERM[%d:%d] ", Get_step_term_index(),
00723 Get_step_term_count());
00724 fprintf(fp, "\n ");
00725 fprintf(fp, "SEG LEN TERM[%d:%d] ", Get_segment_length_term_index(),
00726 Get_segment_length_term_count());
00727 fprintf(fp, "SEG STR TERM[%d:%d] ", Get_segment_stride_term_index(),
00728 Get_segment_stride_term_count());
00729 }
00730 if (Is_assumed_shape())
00731 fprintf(fp, "<ASSUMED_SHAPE> ");
00732 fprintf(fp, "\n");
00733 }
00734
00735
00736
00737
00738 void PROJECTED_REGION::Print(FILE *fp)
00739 {
00740 if (Is_unprojected_region()) {
00741 fprintf(fp, "UN-");
00742 }
00743 fprintf(fp, "PROJECTED_REGION: ");
00744
00745 if (Is_messy_region()) {
00746 fprintf(fp, "messy region");
00747 }
00748 else {
00749 PROJECTED_ARRAY* pa = Get_projected_array();
00750 if (pa && pa != (void*)-1) {
00751 for (INT i = 0; i < Get_num_dims(); ++i) {
00752 Get_projected_node(i)->Print(fp);
00753 }
00754 }
00755 }
00756
00757 fprintf(fp, " depth = %d\n", Get_depth());
00758
00759 #ifdef IPA_SUMMARY
00760 if (Is_passed())
00761 fprintf(fp, "parameter array section, callsite_id = %d, actual_pos = %d\n",
00762 Get_callsite_id(), Get_actual_id());
00763 fprintf(fp, "\n");
00764
00765
00766 PROJECTED_KERNEL* p;
00767 if (p = Get_projected_kernel())
00768 p->Print(fp);
00769 fprintf(fp, "\n");
00770 #endif
00771 }
00772
00773
00774
00775
00776
00777
00778 void PROJECTED_REGION::IPA_LNO_Print_File(FILE* fp,
00779 INT pr_index)
00780 {
00781 if (pr_index == -1)
00782 fprintf(fp, "PROJ_REGION: ");
00783 else
00784 fprintf(fp, "PROJ_REGION[%d]: ", pr_index);
00785 fprintf(fp, "PROJ_NODE[%d:%d] ", Get_id(),
00786 Get_num_dims());
00787 fprintf(fp, "DEPTH(%d) ", Get_depth());
00788 if (Is_messy_region())
00789 fprintf(fp, "<MESSY> ");
00790 if (Is_unprojected_region())
00791 fprintf(fp, "<UNPROJECTED> ");
00792 if (Is_may_kill()) {
00793 fprintf(fp, "MAY_KILL ");
00794 } else if (Is_may_use()) {
00795 fprintf(fp, "MAY_USE ");
00796 } else if (Is_passed()) {
00797 fprintf(fp, " ");
00798 fprintf(fp, "\n");
00799 fprintf(fp, "PASSED ");
00800 fprintf(fp, "CALLSITE[%d] ", Get_callsite_id());
00801 fprintf(fp, "ACTUAL_POSITION(%d) ", Get_actual_id());
00802 } else if (Is_formal()) {
00803 fprintf(fp, "FORMAL ");
00804 }
00805 fprintf(fp, "\n");
00806 }
00807
00808 #if !(defined(linux) || defined(BUILD_OS_DARWIN))
00809
00810
00811
00812 void
00813 PROJECTED_REGION_INFO::Print(FILE *fp)
00814 {
00815 if (Get_projected_region())
00816 Get_projected_region()->Print(fp);
00817 }
00818
00819
00820
00821
00822 void
00823 REGION_ARRAYS::Print(FILE *fp)
00824 {
00825 fprintf(fp, "REGION_ARRAYS for ");
00826 #ifdef IPA_SUMMARY
00827 fprintf(fp, "%s", Summary->Get_symbol(Get_sym_id())->Get_Name());
00828 #else
00829 fprintf(fp, "%s", Symbol_Name(&IPA_Symbol[Get_sym_id()]));
00830 #endif
00831
00832 fprintf(fp, ", element size = %d, ", Get_element_size());
00833
00834 if (Is_bad_alias())
00835 fprintf(fp, "bad alias, ");
00836
00837 if (Is_loop_invariant())
00838 fprintf(fp, "loop invariant, ");
00839
00840 if (Is_def())
00841 fprintf(fp, "def\n");
00842 else if (Is_use())
00843 fprintf(fp, "use\n");
00844 else if (Is_passed())
00845 fprintf(fp, "passed\n");
00846 else if (Is_may_def())
00847 fprintf(fp, "may def\n");
00848 else if (Is_may_use())
00849 fprintf(fp, "may use\n");
00850 else if (Is_formal())
00851 fprintf(fp, "formal\n");
00852 else
00853 fprintf(fp, "UNKNOWN type\n");
00854
00855 if (PROJECTED_REGION_INFO_ARRAY* p = Get_projected_region_array()) {
00856 for (INT i = 0; i < p->Elements(); ++i) {
00857 (*p)[i].Print(fp);
00858 }
00859 }
00860 }
00861
00862
00863
00864
00865 void
00866 CFG_NODE_INFO::Print(FILE *fp)
00867 {
00868 if (Has_calls())
00869 fprintf(fp, "Has calls \n");
00870
00871 INT i;
00872
00873
00874 fprintf(fp," +++++++++ARRAY KILLS_START+++++++++\n");
00875 ARRAY_OF_REGION_ARRAYS* defs = Get_def_array();
00876 for (i = 0; i < defs->Elements(); ++i) {
00877 (*defs)[i].Print(fp);
00878 }
00879 fprintf(fp," +++++++++ARRAY KILLS_FINISHED+++++++++\n");
00880
00881
00882 ARRAY_OF_REGION_ARRAYS* uses = Get_use_array();
00883 fprintf(fp," +++++++++ARRAY EUSES_START+++++++++\n");
00884 for (i = 0 ; i < uses->Elements(); ++i) {
00885 (*uses)[i].Print(fp);
00886 }
00887 fprintf(fp," +++++++++ARRAY EUSES_FINISHED+++++++++\n");
00888
00889
00890 fprintf(fp," +++++++++SCALAR_INFO_START+++++++++\n");
00891 INT_ARRAY* scalar_defs = Get_scalar_def_array();
00892 for (i = 0; i < scalar_defs->Elements();++i) {
00893 SCALAR_INFO* idr = &(*scalar_defs)[i];
00894 #ifdef IPA_SUMMARY
00895 fprintf(fp, "symbol: %s\n", Summary->Get_symbol(idr->Get_id())->Get_Name());
00896 #else
00897 fprintf(fp, "symbol: %s\n", Symbol_Name(&IPA_Symbol[idr->Get_id()]));
00898 #endif
00899 }
00900 fprintf(fp," +++++++++SCALAR_INFO_FINISHED+++++++++\n");
00901 }
00902
00903 #endif