Exemple #1
0
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));
}
Exemple #2
0
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));
}
Exemple #3
0
//All global prs must be mapped.
bool DEX_REGION::verify_ra_res(RA & ra, PRNO2UINT & prno2v)
{
	GLTM * gltm = ra.get_gltm();
	SVECTOR<GLT*> * gltv = gltm->get_gltvec();
	for (UINT i = 0; i < gltm->get_num_of_glt(); i++) {
		GLT * g = gltv->get(i);
		if (g == NULL) { continue; }
		IS_TRUE0(g->has_allocated());
		if (GLT_bbs(g) == NULL) {
			//parameter may be have no occ.
			continue;
		}
		bool find;
		prno2v.get(GLT_prno(g), &find);
		IS_TRUE0(find);
	}

	IR_BB_LIST * bbl = get_bb_list();
	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;
			prno2v.get(LT_prno(l), &find);
			IS_TRUE0(find);
		}
	}
	return true;
}
Exemple #4
0
//All global prs must be mapped.
bool DexRegion::verifyRAresult(RA & ra, Prno2Vreg & prno2v)
{
    GltMgr * gltm = ra.get_gltm();
    Vector<GLT*> * gltv = gltm->get_gltvec();
    for (UINT i = 0; i < gltm->get_num_of_glt(); i++) {
        GLT * g = gltv->get(i);
        if (g == NULL) { continue; }
        ASSERT0(g->has_allocated());
        if (GLT_bbs(g) == NULL) {
            //parameter may be have no occ.
            continue;
        }
        bool find;
        prno2v.get(GLT_prno(g), &find);
        ASSERT0(find);
    }

    BBList * bbl = getBBList();
    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;
            prno2v.get(LT_prno(l), &find);
            ASSERT0(find);
        }
    }
    return true;
}