本文整理汇总了C++中tr::Block::hasPredecessor方法的典型用法代码示例。如果您正苦于以下问题:C++ Block::hasPredecessor方法的具体用法?C++ Block::hasPredecessor怎么用?C++ Block::hasPredecessor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tr::Block
的用法示例。
在下文中一共展示了Block::hasPredecessor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: perform
//.........这里部分代码省略.........
// The following code is to setup the various insert points based on the following diagrams
// of basic blocks:
//
// start: setup: end result after moving runtime guard'
// | | +-------+ <-- privargIns
// | | <-- privargIns |
// +-------+ <-- runtimeIns +-------+
// | | | | Guard'|
// | | V +-------+ <-- runtimeIns
// +-------+ +-------+ |
// | Guard | | Guard | V
// +-------+ +-------+ <-- HCRIns +-------+
// | ===> | ===> | Guard |
// V V +-------+ <-- HCRIns
// +-------+ +-------+ |
// | | | | V
// | | | | +-------+
//
// Note we always split the block - this may create an empty block but preserves the incoming
// control flow we leave the rest to block extension to fix later
block = block->split(block->getLastRealTreeTop(), cfg, true, false);
TR::Block *privargIns = block->getPrevBlock();
TR::Block *runtimeIns = block->getPrevBlock();
TR::Block *HCRIns = block;
// New outer guard so cold paths must be evaluated
evaluatedColdPathLoads = false;
// scan for candidate guards to merge with guard1 identified above
for (TR::Block *nextBlock = block->getNextBlock(); nextBlock; nextBlock = nextBlock->getNextBlock())
{
if (!(nextBlock->getPredecessors().size() == 1) ||
!nextBlock->hasPredecessor(block))
{
break;
}
TR::TreeTop *guard2Tree = NULL;
if (isMergeableGuard(nextBlock->getFirstRealTreeTop()->getNode()))
{
guard2Tree = nextBlock->getFirstRealTreeTop();
}
else if (isMergeableGuard(nextBlock->getLastRealTreeTop()->getNode()))
{
guard2Tree = nextBlock->getLastRealTreeTop();
}
else
break;
TR::Node *guard2 = guard2Tree->getNode();
TR::Block *guard2Block = nextBlock;
// It is not possible to shift an OSR guard unless the destination is already an OSR point
// as the necessary OSR state will not be available
if (guard2->isOSRGuard() && !guard1->isOSRGuard())
break;
TR::Block *insertPoint = isStopTheWorldGuard(guard2) ? HCRIns : runtimeIns;
if (!safeToMoveGuard(insertPoint, guard2Tree, guard1->getBranchDestination(), privArgSymRefs))
break;
// now we figure out if we can redirect guard2 to guard1's cold block
// ie can we do the head merge
TR::Block *cold2 = guard2->getBranchDestination()->getEnclosingBlock();
if (guard1->getInlinedSiteIndex() == guard2->getInlinedSiteIndex())