当前位置: 首页>>代码示例>>C++>>正文


C++ RegionNode::isSubRegion方法代码示例

本文整理汇总了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 "";
  }
开发者ID:2asoft,项目名称:freebsd,代码行数:25,代码来源:RegionPrinter.cpp

示例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);
			}

		}
开发者ID:DrItanium,项目名称:durandal,代码行数:34,代码来源:JSEdgeRemoval.cpp

示例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());
}
开发者ID:Chadi-akel,项目名称:cere,代码行数:10,代码来源:RegionExtractor.cpp


注:本文中的RegionNode::isSubRegion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。