void DEX_REGION::update_ra_res(IN RA & ra, OUT PRNO2UINT & prno2v) { prno2v.maxreg = ra.get_maxreg(); prno2v.paramnum = ra.get_paramnum(); GLTM * gltm = ra.get_gltm(); IR_BB_LIST * bbl = get_bb_list(); prno2v.clean(); for (IR_BB * bb = bbl->get_head(); bb != NULL; bb = bbl->get_next()) { LTM * ltm = gltm->map_bb2ltm(bb); if (ltm == NULL) { continue; } SVECTOR<LT*> * lvec = ltm->get_lt_vec(); for (INT i = 0; i <= lvec->get_last_idx(); i++) { LT * l = lvec->get(i); if (l == NULL) { continue; } IS_TRUE0(l->has_allocated()); bool find; UINT v = prno2v.get(LT_prno(l), &find); if (find) { //each prno is corresponding to a unqiue vreg. IS_TRUE0(v == LT_phy(l)); } else { prno2v.set(LT_prno(l), LT_phy(l)); } } } prno2v.dump(); IS_TRUE0(verify_ra_res(ra, prno2v)); }
void DexRegion::updateRAresult(IN RA & ra, OUT Prno2Vreg & prno2v) { prno2v.maxreg = ra.get_maxreg(); prno2v.paramnum = ra.get_paramnum(); GltMgr * gltm = ra.get_gltm(); BBList * bbl = getBBList(); prno2v.clean(); for (IRBB * bb = bbl->get_head(); bb != NULL; bb = bbl->get_next()) { LTMgr * ltm = gltm->map_bb2ltm(bb); if (ltm == NULL) { continue; } Vector<LT*> * lvec = ltm->get_lt_vec(); for (INT i = 0; i <= lvec->get_last_idx(); i++) { LT * l = lvec->get(i); if (l == NULL) { continue; } ASSERT0(l->has_allocated()); bool find; UINT v = prno2v.get(LT_prno(l), &find); if (find) { //each prno is corresponding to a unqiue vreg. ASSERT0(v == LT_phy(l)); } else { prno2v.set(LT_prno(l), LT_phy(l)); } } } //prno2v.dump(); ASSERT0(verifyRAresult(ra, prno2v)); }