本文整理汇总了C++中SmallInstructionVector::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ SmallInstructionVector::empty方法的具体用法?C++ SmallInstructionVector::empty怎么用?C++ SmallInstructionVector::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmallInstructionVector
的用法示例。
在下文中一共展示了SmallInstructionVector::empty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runOnLoop
bool LoopReroll::runOnLoop(Loop *L, LPPassManager &LPM) {
if (skipOptnoneFunction(L))
return false;
AA = &getAnalysis<AliasAnalysis>();
LI = &getAnalysis<LoopInfo>();
SE = &getAnalysis<ScalarEvolution>();
TLI = &getAnalysis<TargetLibraryInfo>();
DL = getAnalysisIfAvailable<DataLayout>();
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
BasicBlock *Header = L->getHeader();
DEBUG(dbgs() << "LRR: F[" << Header->getParent()->getName() <<
"] Loop %" << Header->getName() << " (" <<
L->getNumBlocks() << " block(s))\n");
bool Changed = false;
// For now, we'll handle only single BB loops.
if (L->getNumBlocks() > 1)
return Changed;
if (!SE->hasLoopInvariantBackedgeTakenCount(L))
return Changed;
const SCEV *LIBETC = SE->getBackedgeTakenCount(L);
const SCEV *IterCount =
SE->getAddExpr(LIBETC, SE->getConstant(LIBETC->getType(), 1));
DEBUG(dbgs() << "LRR: iteration count = " << *IterCount << "\n");
// First, we need to find the induction variable with respect to which we can
// reroll (there may be several possible options).
SmallInstructionVector PossibleIVs;
collectPossibleIVs(L, PossibleIVs);
if (PossibleIVs.empty()) {
DEBUG(dbgs() << "LRR: No possible IVs found\n");
return Changed;
}
ReductionTracker Reductions;
collectPossibleReductions(L, Reductions);
// For each possible IV, collect the associated possible set of 'root' nodes
// (i+1, i+2, etc.).
for (SmallInstructionVector::iterator I = PossibleIVs.begin(),
IE = PossibleIVs.end(); I != IE; ++I)
if (reroll(*I, L, Header, IterCount, Reductions)) {
Changed = true;
break;
}
return Changed;
}