本文整理汇总了C++中RegionNode::isSubRegion方法的典型用法代码示例。如果您正苦于以下问题:C++ RegionNode::isSubRegion方法的具体用法?C++ RegionNode::isSubRegion怎么用?C++ RegionNode::isSubRegion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RegionNode
的用法示例。
在下文中一共展示了RegionNode::isSubRegion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getEdgeAttributes
std::string getEdgeAttributes(RegionNode *srcNode,
GraphTraits<RegionInfo *>::ChildIteratorType CI,
RegionInfo *G) {
RegionNode *destNode = *CI;
if (srcNode->isSubRegion() || destNode->isSubRegion())
return "";
// In case of a backedge, do not use it to define the layout of the nodes.
BasicBlock *srcBB = srcNode->getNodeAs<BasicBlock>();
BasicBlock *destBB = destNode->getNodeAs<BasicBlock>();
Region *R = G->getRegionFor(destBB);
while (R && R->getParent())
if (R->getParent()->getEntry() == destBB)
R = R->getParent();
else
break;
if (R && R->getEntry() == destBB && R->contains(srcBB))
return "constraint=false";
return "";
}
示例2: padExitBlocks
void JSEdgeRemovalPass::padExitBlocks(RegionInfo& ri, Region* target) {
for(Region::element_iterator i = target->element_begin(), e = target->element_end(); i != e; ++i) {
RegionNode* rn = (RegionNode*)(*i);
if(rn->isSubRegion()) {
Region* subRegion = rn->getNodeAs<Region>();
padExitBlocks(ri, subRegion);
}
}
BasicBlock* exit = target->getExit();
if(exit != NULL) {
//we need to split the block into two parts to give padding space
//Keep the phi nodes and landing pad instructions in the original
//block and push all instructions into the new block below. That
//way we have convergence yet space to move elements up onto a
//given path if it turns out that the given instruction can't
//32 is a good number
unsigned count = 0;
SmallVector<BasicBlock*,32> elements;
for(pred_iterator PI = pred_begin(exit), E = pred_end(exit); PI != E; ++PI) {
BasicBlock* bb = *PI;
if(target->contains(bb)) {
elements.push_back(bb);
}
count++;
}
if(elements.size() > 0 && count != elements.size()) {
BasicBlock* update = SplitBlockPredecessors(exit, elements, "Pad", this);
target->replaceExit(update);
}
//ri.splitBlock(update, exit);
}
}
示例3: buildExtractionBlockSet
/// \brief Helper to call buildExtractionBlockSet with a RegionNode.
static SetVector<BasicBlock *> buildExtractionBlockSet(const RegionNode &RN) {
if (!RN.isSubRegion())
// Just a single BasicBlock.
return buildExtractionBlockSet(RN.getNodeAs<BasicBlock>());
const Region &R = *RN.getNodeAs<Region>();
return buildExtractionBlockSet(R.block_begin(), R.block_end());
}