本文整理汇总了C++中tr::Node::incFutureUseCount方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::incFutureUseCount方法的具体用法?C++ Node::incFutureUseCount怎么用?C++ Node::incFutureUseCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tr::Node
的用法示例。
在下文中一共展示了Node::incFutureUseCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stackRegion
int32_t TR::DeadTreesElimination::process(TR::TreeTop *startTree, TR::TreeTop *endTree)
{
TR::StackMemoryRegion stackRegion(*comp()->trMemory());
LongestPathMap longestPaths(std::less<TR::Node*>(), stackRegion);
typedef TR::typed_allocator<CRAnchor, TR::Region&> CRAnchorAlloc;
typedef TR::forward_list<CRAnchor, CRAnchorAlloc> CRAnchorList;
CRAnchorList anchors(stackRegion);
vcount_t visitCount = comp()->incOrResetVisitCount();
TR::TreeTop *treeTop;
for (treeTop = startTree; (treeTop != endTree); treeTop = treeTop->getNextTreeTop())
treeTop->getNode()->initializeFutureUseCounts(visitCount);
TR::Block *block = NULL;
bool delayedRegStoresBeforeThisPass = _delayedRegStores;
// Update visitCount as they are used in this optimization and need to be
visitCount = comp()->incOrResetVisitCount();
for (TR::TreeTopIterator iter(startTree, comp()); iter != endTree; ++iter)
{
TR::Node *node = iter.currentTree()->getNode();
if (node->getOpCodeValue() == TR::BBStart)
{
block = node->getBlock();
if (!block->isExtensionOfPreviousBlock())
longestPaths.clear();
}
int vcountLimit = MAX_VCOUNT - 3;
if (comp()->getVisitCount() > vcountLimit)
{
dumpOptDetails(comp(),
"%sVisit count %d exceeds limit %d; stopping\n",
optDetailString(), comp()->getVisitCount(), vcountLimit);
return 0;
}
// correct at all intermediate stages
//
if ((node->getOpCodeValue() != TR::treetop) &&
(!node->getOpCode().isAnchor() || (node->getFirstChild()->getReferenceCount() != 1)) &&
(!node->getOpCode().isStoreReg() || (node->getFirstChild()->getReferenceCount() != 1)) &&
(delayedRegStoresBeforeThisPass ||
(iter.currentTree() == block->getLastRealTreeTop()) ||
!node->getOpCode().isStoreReg() ||
(node->getVisitCount() == visitCount)))
{
if (node->getOpCode().isAnchor() && node->getFirstChild()->getOpCode().isLoadIndirect())
anchors.push_front(CRAnchor(iter.currentTree(), block));
TR::TransformUtil::recursivelySetNodeVisitCount(node, visitCount);
continue;
}
if (node->getOpCode().isStoreReg())
_delayedRegStores = true;
TR::Node *child = node->getFirstChild();
if (child->getOpCodeValue() == TR::PassThrough)
{
TR::Node *newChild = child->getFirstChild();
node->setAndIncChild(0, newChild);
newChild->incFutureUseCount();
if (child->getReferenceCount() <= 1)
optimizer()->prepareForNodeRemoval(child);
child->recursivelyDecReferenceCount();
recursivelyDecFutureUseCount(child);
child = newChild;
}
bool treeTopCanBeEliminated = false;
// If the treetop child has been seen before then it must be anchored
// somewhere above already; so we don't need the treetop to be anchoring
// this node (as the computation is already done at the first reference to
// the node).
//
if (visitCount == child->getVisitCount())
{
treeTopCanBeEliminated = true;
}
else
{
TR::ILOpCode &childOpCode = child->getOpCode();
TR::ILOpCodes opCodeValue = childOpCode.getOpCodeValue();
bool seenConditionalBranch = false;
bool callWithNoSideEffects = child->getOpCode().isCall() &&
child->getSymbolReference()->getSymbol()->isResolvedMethod() &&
child->getSymbolReference()->getSymbol()->castToResolvedMethodSymbol()->isSideEffectFree();
if (callWithNoSideEffects)
{
treeTopCanBeEliminated = true;
}
else if (!((childOpCode.isCall() && !callWithNoSideEffects) ||
childOpCode.isStore() ||
//.........这里部分代码省略.........