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 #include <map>
00045
00046 #include "cgtarget.h"
00047 #include "op_list.h"
00048 #include "cg_dep_graph.h"
00049 #include "bb.h"
00050
00051 #include "speculation.h"
00052 #include "recovery.h"
00053 #include "scheduler.h"
00054 #include "dag.h"
00055 #include "vt_region.h"
00056 #include "tracing.h"
00057 #include "ipfec_defs.h"
00058 #include "vt_dag.h"
00059 #include "vt_partition.h"
00060 #include "op.h"
00061 #include "cgtarget.h"
00062 #include "ipfec_options.h"
00063
00064
00065 std::vector< std::pair<OP*, OP*> > load_chk_pairs;
00066
00067
00068 OP*
00069 Change_ld_Form(OP *load_op, ISA_ENUM_CLASS_VALUE target_form)
00070 {
00071 Is_True(OP_load(load_op),("not a load OP!"));
00072
00073 BOOL compatible = FALSE;
00074 BOOL float_op = OP_Is_Float_Mem(load_op) ? TRUE : FALSE;
00075 compatible = float_op ? ((target_form >= ECV_fldtype_s) && (target_form <= ECV_fldtype)) :
00076 ((target_form >= ECV_ldtype_s) && (target_form <= ECV_ldtype));
00077 FmtAssert(compatible,("load op and ldtype not compatible."));
00078
00079 if(!float_op && (target_form < ECV_ldtype_s || target_form > ECV_ldtype_sa) ||
00080 float_op && (target_form < ECV_fldtype_s || target_form > ECV_fldtype_sa)) {
00081 return NULL;
00082 }
00083
00084 if( TN_enum(OP_opnd(load_op, enum_ldtype_pos)) == target_form)
00085 return load_op;
00086
00087 Set_OP_opnd(load_op, enum_ldtype_pos, Gen_Enum_TN(target_form));
00088 Set_OP_speculative(load_op);
00089
00090 return load_op;
00091 }
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 static void
00112 Build_Incoming_Edges(OP *spec_ld, OP *chk)
00113 {
00114 UINT8 opnd = OP_chk_a(chk) ? 2 : 1;
00115 new_arc(CG_DEP_REGIN, spec_ld, chk, 0, opnd, FALSE);
00116 for(ARC_LIST* arcs = OP_preds(spec_ld); arcs; arcs = ARC_LIST_rest(arcs)) {
00117 ARC* arc = ARC_LIST_first(arcs);
00118 OP* op = ARC_pred(arc);
00119 if(OP_bb(op) != OP_bb(chk))
00120 continue;
00121 if(ARC_is_spec(arc) && !OP_Scheduled(op)) {
00122 if(OP_store(op)){
00123 new_arc_with_latency(CG_DEP_PRECHK, op, chk, 1, 0, 0, FALSE);
00124 continue;
00125 }
00126 if(ARC_kind(arc) == CG_DEP_CTLSPEC) {
00127 new_arc_with_latency(CG_DEP_CTLSPEC, op, chk, 1, 0, 0, FALSE);
00128 continue;
00129 }
00130 if(OP_chk(op)){
00131 new_arc_with_latency(CG_DEP_PRECHK, op, chk, 0, 0, 0, FALSE);
00132 continue;
00133 }
00134 Is_True(!OP_br(op),("A branch can not get to here!"));
00135 }
00136 }
00137 for(OP* op = OP_prev(chk); op; op = OP_prev(op)){
00138 if(OP_chk(op)){
00139 new_arc_with_latency(CG_DEP_PRECHK, op, chk, 0, 0, 0, FALSE);
00140 }
00141 }
00142 }
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157 BOOL
00158 OP_baneful(OP *op)
00159 {
00160
00161 if(OP_like_store(op))
00162 return TRUE;
00163
00164 if(OP_results(op) == 0)
00165 return TRUE;
00166
00167 for (INT i = 0; i < OP_results(op); i++) {
00168 TN *result = OP_result(op, i);
00169 if( !TN_is_GFP(result) )
00170 return TRUE;
00171 }
00172
00173 switch (OP_code(op)) {
00174 default:
00175 return FALSE;
00176 case TOP_mov_f_cpuid:
00177 case TOP_mov_f_dbr:
00178 case TOP_mov_f_ibr:
00179 case TOP_mov_f_msr:
00180 case TOP_mov_f_pkr:
00181 case TOP_mov_f_pmc:
00182 case TOP_mov_f_pmd:
00183 case TOP_mov_f_rr:
00184 case TOP_tpa:
00185 case TOP_probe_r:
00186 case TOP_probe_w:
00187 case TOP_probe_i_r:
00188 case TOP_probe_i_w:
00189 case TOP_alloc_3:
00190 case TOP_alloc:
00191 case TOP_lfetch_r:
00192 case TOP_lfetch_r_excl:
00193 case TOP_lfetch_r_fault:
00194 case TOP_lfetch_r_fault_excl:
00195 case TOP_lfetch_i:
00196 case TOP_lfetch_i_excl:
00197 case TOP_lfetch_i_fault:
00198 case TOP_lfetch_i_fault_excl:
00199 case TOP_xchg1:
00200 case TOP_xchg2:
00201 case TOP_xchg4:
00202 case TOP_xchg8:
00203 case TOP_ldf_fill:
00204 case TOP_ld8_fill:
00205 case TOP_ldf_r_fill:
00206 case TOP_ld8_r_fill:
00207 case TOP_ldfp8_i:
00208 case TOP_ldfpd_i:
00209 case TOP_ldfps_i:
00210 case TOP_ldf8_r:
00211 case TOP_ldfd_r:
00212 case TOP_ldfe_r:
00213 case TOP_ldfs_r:
00214 case TOP_ldf8_i:
00215 case TOP_ldfd_i:
00216 case TOP_ldfe_i:
00217 case TOP_ldfs_i:
00218 case TOP_ldf_i_fill:
00219 case TOP_ld8_i_fill:
00220 case TOP_cmpxchg1:
00221 case TOP_cmpxchg2:
00222 case TOP_cmpxchg4:
00223 case TOP_cmpxchg8:
00224 case TOP_fetchadd4:
00225 case TOP_fetchadd8:
00226 case TOP_stf8_i:
00227 case TOP_stf_i_spill:
00228 case TOP_stfd_i:
00229 case TOP_stfe_i:
00230 case TOP_stfs_i:
00231 case TOP_st8_i_spill:
00232 case TOP_st1_i:
00233 case TOP_st2_i:
00234 case TOP_st4_i:
00235 case TOP_st8_i:
00236 case TOP_spadjust:
00237 case TOP_intrncall:
00238 case TOP_ifixup:
00239 case TOP_ffixup:
00240 case TOP_dfixup:
00241 return TRUE;
00242 }
00243 }
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257 static void
00258 Compute_Topological_Order(REGIONAL_CFG_NODE* root,
00259 std::list<REGIONAL_CFG_NODE*>& node_list,
00260 std::set<REGIONAL_CFG_NODE*>& visited)
00261 {
00262 if( root == NULL ) return;
00263 for (CFG_SUCC_NODE_ITER succ_iter(root); succ_iter != 0; ++succ_iter) {
00264 REGIONAL_CFG_NODE* node = *succ_iter;
00265 if(visited.find(node) != visited.end())
00266 continue;
00267 Compute_Topological_Order(node, node_list, visited);
00268 }
00269 node_list.push_front(root);
00270 visited.insert(root);
00271 return;
00272 }
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288 static void
00289 Build_Outgoing_Edges(OP *spec_ld, OP *chk)
00290 {
00291
00292 if( IPFEC_Hold_Uses && CGTARG_Is_OP_Speculative_Load(spec_ld)){
00293 for (ARC_LIST *arcs = OP_succs(spec_ld); arcs; arcs = ARC_LIST_rest(arcs)) {
00294 ARC *arc = ARC_LIST_first(arcs);
00295 new_arc(CG_DEP_POSTCHK, chk, ARC_succ(arc), 0, 0, FALSE);
00296 }
00297 return;
00298 }
00299
00300 typedef mempool_allocator<TN*> TN_ALLOC;
00301 typedef std::set<TN*, compare_tn, TN_ALLOC> TNs;
00302
00303 typedef mempool_allocator<OP*> OP_ALLOC;
00304 typedef std::set<OP*, compare_op, OP_ALLOC> OPs;
00305
00306 typedef mempool_allocator< std::pair<REGIONAL_CFG_NODE* const, TNs> > NODE_TNs_ALLOC;
00307 typedef std::map<REGIONAL_CFG_NODE*, TNs, compare_node, NODE_TNs_ALLOC> NODE_TNs_MAP;
00308 typedef mempool_allocator< std::pair<REGIONAL_CFG_NODE* const, OPs> > NODE_OPs_ALLOC;
00309 typedef std::map<REGIONAL_CFG_NODE*, OPs, compare_node, NODE_OPs_ALLOC> NODE_OPs_MAP;
00310
00311 NODE_TNs_MAP spec_chain_live;
00312 NODE_TNs_MAP spec_chain_def;
00313 NODE_OPs_MAP dependent_ops;
00314
00315 BB* home_bb = OP_bb(chk);
00316 REGIONAL_CFG_NODE* root = Regional_Cfg_Node(home_bb);
00317
00318 std::list<REGIONAL_CFG_NODE* > node_list;
00319 std::set<REGIONAL_CFG_NODE* > visited;
00320
00321 Compute_Topological_Order(root, node_list, visited);
00322 visited.clear();
00323
00324
00325
00326 for (INT i = 0; i < OP_opnds(spec_ld); i++) {
00327 TN* opnd = OP_opnd(spec_ld, i);
00328 if (TN_is_register(opnd) && !TN_is_const_reg(opnd)){
00329 Is_True(!TN_Pair_In_OP(spec_ld, opnd, opnd), ("can not be a post-incr load!"));
00330 spec_chain_live[root].insert(opnd);
00331 }
00332 }
00333
00334
00335
00336 TNs spec_ld_tgt;
00337 for (INT i = 0; i < OP_results(spec_ld); i++) {
00338 TN* rslt = OP_result(spec_ld, i);
00339 Is_True(TN_is_register(rslt), ("rslt tn must be a register tn!"));
00340 spec_chain_def[root].insert(rslt);
00341 spec_ld_tgt.insert(rslt);
00342 }
00343
00344
00345 TN* chk_ptn = OP_opnd(chk,0);
00346 TN* spec_ld_ptn = OP_opnd(chk,0);
00347
00348
00349 for(std::list<REGIONAL_CFG_NODE*>::iterator iter = node_list.begin();
00350 iter != node_list.end();
00351 iter++) {
00352 REGIONAL_CFG_NODE* node=(*iter);
00353 if( !node->Is_Region() && BB_exit(node->BB_Node()) )
00354 continue;
00355
00356
00357 bool the_first_iter = true;
00358 for (CFG_PRED_NODE_ITER pred_iter(node); pred_iter != 0; ++pred_iter) {
00359 if ( visited.find(*pred_iter) == visited.end())
00360 continue;
00361 spec_chain_def[node].insert(spec_chain_def[*pred_iter].begin(), spec_chain_def[*pred_iter].end());
00362 spec_chain_live[node].insert(spec_chain_live[*pred_iter].begin(), spec_chain_live[*pred_iter].end());
00363 if(the_first_iter){
00364 dependent_ops[node].insert(dependent_ops[*pred_iter].begin(), dependent_ops[*pred_iter].end());
00365 the_first_iter=false;
00366 }else{
00367 for(std::set<OP*, compare_op, OP_ALLOC>::iterator iter_op = dependent_ops[node].begin();
00368 iter_op != dependent_ops[node].end(); ){
00369 if(dependent_ops[*pred_iter].find(*iter_op) == dependent_ops[*pred_iter].end()){
00370 std::set<OP*, compare_op, OP_ALLOC>::iterator iter_op_er;
00371 iter_op_er=iter_op;
00372 ++iter_op;
00373 dependent_ops[node].erase(iter_op_er);
00374 }else{
00375 ++iter_op;
00376 }
00377 }
00378 }
00379
00380 }
00381
00382 visited.insert(node);
00383 if(node->Is_Region())
00384 continue;
00385 BB* bb = node->BB_Node();
00386
00387 OP* start_op = bb == OP_bb(chk) ? OP_next(chk): BB_first_op(bb);
00388 for(OP* op = start_op; op != NULL; op = OP_next(op)) {
00389
00390 TNs tmp_live_in;
00391 BOOL flow_dep = FALSE;
00392 BOOL flow_on_predicate = FALSE;
00393 BOOL flow_on_opnd = FALSE;
00394 BOOL output_dep = FALSE;
00395 TN* flow_dep_tn = NULL;
00396 TN* cur_ptn = NULL;
00397
00398
00399
00400 if(dependent_ops[node].find(op) != dependent_ops[node].end()){
00401 goto handle_succs;
00402 }
00403
00404
00405
00406
00407
00408
00409
00410 if(OP_bb(chk) == OP_bb(op) && OP_baneful(op))
00411 goto gen_arc;
00412
00413
00414
00415
00416
00417
00418 for(INT i = 0; i < OP_results(op); i++) {
00419 TN* rslt = OP_result(op, i);
00420 if( spec_ld_tgt.find(rslt) != spec_ld_tgt.end()
00421 || spec_chain_live[node].find(rslt) != spec_chain_live[node].end()){
00422 goto gen_arc;
00423 }
00424 if(spec_chain_def[node].find(rslt) != spec_chain_def[node].end()){
00425 output_dep = TRUE;
00426 }
00427 }
00428
00429 for(INT i = 0; i < OP_opnds(op); i++) {
00430 TN* opnd = OP_opnd(op, i);
00431 if( TN_is_register(opnd)
00432 && !TN_is_const_reg(opnd)
00433 && spec_chain_def[node].find(opnd) != spec_chain_def[node].end()){
00434 flow_dep = TRUE;
00435 if(OP_has_predicate(op) && i == OP_PREDICATE_OPND){
00436 flow_on_predicate = TRUE;
00437 }else{
00438 flow_on_opnd = TRUE;
00439 }
00440 }
00441 }
00442
00443
00444
00445
00446 if(!flow_dep && !output_dep){
00447
00448
00449
00450
00451 continue;
00452 }
00453
00454
00455
00456
00457 if(OP_baneful(op)){
00458 goto gen_arc;
00459 }
00460
00461 if(OP_has_predicate(op)){
00462 cur_ptn = OP_opnd(op, 0);
00463 if( !flow_on_predicate
00464 && cur_ptn != True_TN
00465 && cur_ptn != chk_ptn
00466 && cur_ptn != spec_ld_ptn){
00467 goto gen_arc;
00468 }
00469 }
00470
00471
00472
00473
00474
00475
00476
00477 if(flow_on_predicate && CGTARG_Is_OP_Advanced_Load(spec_ld)){
00478 Is_True(!TN_is_true_pred(cur_ptn),("flow dependent can't caused by predicate register!"));
00479 goto gen_arc;
00480 }
00481
00482
00483
00484
00485 if(flow_dep && flow_on_opnd && OP_load(op))
00486 {
00487 ARC *arc = new_arc_with_latency(CG_DEP_POSTCHK, chk, op, 0, 0, 0, FALSE);
00488 Set_ARC_is_dotted(arc, TRUE);
00489 }
00490
00491
00492
00493 for (INT i = 0; i < OP_opnds(op); i++) {
00494 TN* opnd = OP_opnd(op, i);
00495 if( TN_is_register(opnd)
00496 && !TN_is_const_reg(opnd)
00497 && spec_chain_def[node].find(opnd) == spec_chain_def[node].end())
00498 {
00499 if(TN_Pair_In_OP(op,opnd,opnd)){
00500
00501 goto gen_arc;
00502 }else{
00503 tmp_live_in.insert(opnd);
00504 }
00505 }
00506 }
00507 spec_chain_live[node].insert(tmp_live_in.begin(),tmp_live_in.end());
00508
00509
00510 if(flow_dep){
00511 for (INT i = 0; i < OP_results(op); i++) {
00512 TN *rslt = OP_result(op, i);
00513 Is_True(TN_is_register(rslt),("result should be a register tn!"));
00514 spec_chain_def[node].insert(rslt);
00515 }
00516 }
00517 continue;
00518
00519 gen_arc:
00520 new_arc_with_latency(CG_DEP_POSTCHK, chk, op, 0, 0, 0, FALSE);
00521
00522 handle_succs:
00523 for (ARC_LIST *arcs = OP_succs(op); arcs; arcs = ARC_LIST_rest(arcs)){
00524 ARC *arc = ARC_LIST_first(arcs);
00525 OP *succ = ARC_succ(arc);
00526 if(!OP_br(op) && !ARC_is_spec(arc))
00527 dependent_ops[node].insert(succ);
00528 }
00529 }
00530
00531 }
00532 }
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544 static void Connect_Clones_with_CHK(std::vector<OP *>& clones, OP *chk)
00545 {
00546
00547 std::vector<OP *>::iterator iter;
00548 for(iter = clones.begin() ; iter != clones.end(); ++iter) {
00549
00550 OP *op = *iter;
00551 Is_True(OP_load(op),("not a load OP"));
00552
00553 if( CGTARG_Is_OP_Speculative(op) && !CGTARG_Is_OP_Advanced_Load(op)){
00554
00555 TN *ldtype_tn = OP_Is_Float_Mem(op) ? Gen_Enum_TN(ECV_fldtype_sa) :
00556 Gen_Enum_TN(ECV_ldtype_sa);
00557 Set_OP_opnd(op, enum_ldtype_pos, ldtype_tn);
00558 new_arc(CG_DEP_PRECHK, op, chk, 0, 0, FALSE);
00559 }
00560 }
00561 }
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576 OP*
00577 Local_Insert_CHK(OP *spec_ld, OP *point, TN *pr_tn)
00578 {
00579
00580 Is_True(CGTARG_Is_OP_Speculative(spec_ld),("not a speculative load!"));
00581 Is_True(point != NULL,("Insert position cannot be NULL!"));
00582 Is_True(OP_bb(spec_ld) == OP_bb(point),("not in the same BB!"));
00583
00584 OP *chk;
00585
00586 if( CGTARG_Is_OP_Advanced_Load(spec_ld) ) {
00587
00588 TN *aclr_tn = Gen_Enum_TN(ECV_aclr_clr);
00589 TN *reg_tn = OP_result(spec_ld, 0);
00590 TN *target_tn = Gen_Label_TN(Gen_Label_For_BB(OP_bb(spec_ld)), 0);
00591
00592 if(TN_is_float(reg_tn)){
00593 chk = Mk_OP(TOP_chk_f_a, pr_tn, aclr_tn, reg_tn, target_tn);
00594 } else {
00595 chk = Mk_OP(TOP_chk_a, pr_tn, aclr_tn, reg_tn, target_tn);
00596 }
00597 } else {
00598
00599 TN *reg_tn = OP_result(spec_ld, 0);
00600 TN *target_tn = Gen_Label_TN(Gen_Label_For_BB(OP_bb(spec_ld)), 0);
00601
00602 if(TN_is_float(reg_tn)){
00603 chk = Mk_OP(TOP_chk_f_s, pr_tn, reg_tn, target_tn);
00604 } else {
00605 chk = Mk_OP(TOP_chk_s, pr_tn, reg_tn, target_tn);
00606 }
00607 }
00608
00609 BB_Insert_Op_After(OP_bb(spec_ld), point, chk);
00610
00611 if (Get_Trace(TP_A_RBG, TT_RBG_DRAW_GLBL_CFG)) {
00612 draw_global_cfg();
00613 }
00614
00615 Build_Outgoing_Edges(spec_ld, chk);
00616 Build_Incoming_Edges(spec_ld, chk);
00617
00618 load_chk_pairs.push_back(std::pair<OP*,OP*>(spec_ld,chk));
00619
00620 return chk;
00621 }
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639 OP*
00640 Insert_CHK(OP* primary_ld, std::vector<OP *>& copys, BB* home_bb, OP* pos, TN* pr_tn)
00641 {
00642
00643 Is_True(CGTARG_Is_OP_Speculative(primary_ld),("not a speculative load OP!"));
00644
00645 OP *chk;
00646 if( !copys.empty() || CGTARG_Is_OP_Advanced_Load(primary_ld) ) {
00647
00648
00649
00650
00651
00652
00653 TN *aclr_tn = Gen_Enum_TN(ECV_aclr_clr);
00654 TN *reg_tn = OP_result(primary_ld, 0);
00655 TN *target_tn = Gen_Label_TN(Gen_Label_For_BB(home_bb), 0);
00656
00657 if(TN_is_float(reg_tn)){
00658 chk = Mk_OP(TOP_chk_f_a, pr_tn, aclr_tn, reg_tn, target_tn);
00659 } else {
00660 chk = Mk_OP(TOP_chk_a, pr_tn, aclr_tn, reg_tn, target_tn);
00661 }
00662 } else {
00663
00664 TN *reg_tn = OP_result(primary_ld, 0);
00665 TN *target_tn = Gen_Label_TN(Gen_Label_For_BB(home_bb), 0);
00666
00667 if(TN_is_float(reg_tn)){
00668 chk = Mk_OP(TOP_chk_f_s, pr_tn, reg_tn, target_tn);
00669 } else {
00670 if(IPFEC_Force_CHK_Fail){
00671 chk = Mk_OP(TOP_chk_s_m, pr_tn, reg_tn, target_tn);
00672 } else {
00673 chk = Mk_OP(TOP_chk_s, pr_tn, reg_tn, target_tn);
00674 }
00675 }
00676 }
00677
00678 OP_srcpos(chk) = OP_srcpos(primary_ld);
00679
00680 if(pos != NULL){
00681 Is_True(OP_bb(pos) == home_bb,("Position error!"));
00682 BB_Insert_Op_After(home_bb, pos, chk);
00683 } else {
00684 BB_Prepend_Op(home_bb, chk);
00685 }
00686
00687 Build_Outgoing_Edges(primary_ld, chk);
00688 Build_Incoming_Edges(primary_ld, chk);
00689
00690 if (!copys.empty())
00691 Connect_Clones_with_CHK(copys,chk);
00692
00693
00694 load_chk_pairs.push_back(std::pair<OP*,OP*>(primary_ld,chk));
00695 return chk;
00696 }
00697
00698 void
00699 Set_Speculative_Chain_Begin_Point(OP* chk_op, OP* load_op)
00700 {
00701 std::vector< std::pair<OP*,OP*> >::iterator iter;
00702 for(iter = load_chk_pairs.begin(); iter != load_chk_pairs.end(); ++iter){
00703 OP* second = iter->second;
00704 if(chk_op == second){
00705 iter->first = load_op;
00706 break;
00707 }
00708 }
00709 return;
00710 }
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722 BOOL
00723 Is_Control_Speculation_Gratuitous(OP* load, BB* target_bb, OP* pos)
00724 {
00725 TN* base_tn;
00726 TN* ofst_tn;
00727 OP_Base_Offset_TNs(load,&base_tn,&ofst_tn);
00728 BB* cur_bb = target_bb;
00729 for(OP* op = pos ? pos : BB_last_op(cur_bb);;){
00730 if(op == NULL){
00731 if(BB* pred = BB_Unique_Predecessor(cur_bb)){
00732
00733 cur_bb = pred;
00734 op = BB_last_op(cur_bb);
00735 continue;
00736 }else{
00737 return FALSE;
00738 }
00739 }else{
00740 if(OP_Defs_TN(op,base_tn)){
00741 return FALSE;
00742 }else{
00743 if((OP_load(op) || OP_store(op)) && !CGTARG_Is_OP_Speculative_Load(op)){
00744 TN* base;
00745 TN* ofst;
00746 OP_Base_Offset_TNs(op,&base,&ofst);
00747 if((base_tn == base) && (OP_opnd(op,TOP_Find_Operand_Use(OP_code(op),OU_predicate)) == True_TN)){
00748 return TRUE;
00749 }
00750 }
00751 op = OP_prev(op);
00752 continue;
00753 }
00754 }
00755 }
00756 }
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766 void
00767 Delete_Recovery_Info_For_BB(BB *bb)
00768 {
00769 for (OP *op = BB_first_op(bb); op != NULL; op = OP_next(op)) {
00770 if (OP_chk(op)) {
00771 std::vector< std::pair<OP*,OP*> >::iterator iter;
00772 for(iter = load_chk_pairs.begin();
00773 iter != load_chk_pairs.end(); ++iter)
00774 {
00775 OP* second = iter->second;
00776 if(second == op){
00777 load_chk_pairs.erase(iter);
00778 break;
00779 }
00780 }
00781 }
00782 }
00783 }
00784
00785
00786
00787
00788
00789
00790
00791
00792 BOOL
00793 BB_Hold_Disjoint_Speculative_Code(BB* bb)
00794 {
00795 for(std::vector< std::pair<OP*, OP*> >::iterator iter = load_chk_pairs.begin();
00796 iter != load_chk_pairs.end(); ++iter)
00797 {
00798 OP* first = iter->first;
00799 OP* second = iter->second;
00800 if(first->bb != second->bb &&
00801 (first->bb == bb || second->bb == bb))
00802 {
00803 return TRUE;
00804 }
00805 }
00806 return FALSE;
00807 }
00808
00809