void Region::lowerIRTreeToLowestHeight(OptCtx & oc) { SimpCtx simp; if (g_is_lower_to_pr_mode) { simp.set_simp_to_pr_mode(); } if (g_do_ssa) { //Note if this flag enable, //AA may generate imprecise result. //TODO: use SSA info to improve the precision of AA. simp.set_simp_land_lor(); simp.set_simp_lnot(); simp.set_simp_cf(); } //Simplify IR tree if it is needed. simplifyBBlist(get_bb_list(), &simp); if (SIMP_need_recon_bblist(&simp)) { //New BB boundary IR generated, rebuilding CFG. if (reconstructBBlist(oc)) { get_cfg()->rebuild(oc); get_cfg()->removeEmptyBB(oc); get_cfg()->computeExitList(); } } if (SIMP_changed(&simp)) { //We perfer flow sensitive analysis as default. get_aa()->set_flow_sensitive(true); get_aa()->perform(oc); //The primary actions must do are computing IR reference //and reach def. UINT action = SOL_REACH_DEF|SOL_REF; if (g_do_ivr) { //IVR needs available reach def. action |= SOL_AVAIL_REACH_DEF; } //DU mananger may use the context info supplied by AA. get_du_mgr()->perform(oc, action); //Compute the DU chain. get_du_mgr()->computeMDDUChain(oc); } }
//Initialize alias analysis. IR_AA * DEX_REGION::init_aa(OPT_CTX & oc) { IS_TRUE0(RU_ana(this)); if (get_aa() == NULL) { DEX_AA * aa = new DEX_AA(this); RU_ana(this)->m_ir_aa = aa; aa->init_may_ptset(); aa->set_flow_sensitive(true); aa->perform(oc); } return get_aa(); }