本文整理汇总了C++中IR::removeSSAUse方法的典型用法代码示例。如果您正苦于以下问题:C++ IR::removeSSAUse方法的具体用法?C++ IR::removeSSAUse怎么用?C++ IR::removeSSAUse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IR
的用法示例。
在下文中一共展示了IR::removeSSAUse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeSuccessorDesignatePhiOpnd
//Before removing bb or change bb successor,
//you need remove the related PHI operand if BB successor has PHI stmt.
void IRBB::removeSuccessorDesignatePhiOpnd(CFG<IRBB, IR> * cfg, IRBB * succ)
{
ASSERT0(cfg && succ);
IR_CFG * ircfg = (IR_CFG*)cfg;
Region * ru = ircfg->get_ru();
UINT const pos = ircfg->WhichPred(this, succ);
for (IR * ir = BB_first_ir(succ); ir != NULL; ir = BB_next_ir(succ)) {
if (!ir->is_phi()) { break; }
ASSERT0(cnt_list(PHI_opnd_list(ir)) == succ->getNumOfPred(cfg));
IR * opnd;
UINT lpos = pos;
for (opnd = PHI_opnd_list(ir); lpos != 0; opnd = opnd->get_next()) {
ASSERT0(opnd);
lpos--;
}
if (opnd == NULL) {
//PHI does not contain any operand.
continue;
}
opnd->removeSSAUse();
((CPhi*)ir)->removeOpnd(opnd);
ru->freeIRTree(opnd);
}
}
示例2: removeSuccessorPhiOpnd
//Before removing bb, revising phi opnd if there are phis
//in one of bb's successors.
void IRBB::removeSuccessorPhiOpnd(CFG<IRBB, IR> * cfg)
{
IR_CFG * ircfg = (IR_CFG*)cfg;
Region * ru = ircfg->get_ru();
Vertex * vex = ircfg->get_vertex(BB_id(this));
ASSERT0(vex);
for (EdgeC * out = VERTEX_out_list(vex);
out != NULL; out = EC_next(out)) {
Vertex * succ_vex = EDGE_to(EC_edge(out));
IRBB * succ = ircfg->get_bb(VERTEX_id(succ_vex));
ASSERT0(succ);
UINT const pos = ircfg->WhichPred(this, succ);
for (IR * ir = BB_first_ir(succ);
ir != NULL; ir = BB_next_ir(succ)) {
if (!ir->is_phi()) { break; }
ASSERT0(cnt_list(PHI_opnd_list(ir)) ==
cnt_list(VERTEX_in_list(succ_vex)));
IR * opnd;
UINT lpos = pos;
for (opnd = PHI_opnd_list(ir);
lpos != 0; opnd = IR_next(opnd)) {
ASSERT0(opnd);
lpos--;
}
opnd->removeSSAUse();
((CPhi*)ir)->removeOpnd(opnd);
ru->freeIRTree(opnd);
}
}
}