bool CallAnalyzer::visitCatchReturnInst(CatchReturnInst &CRI) {
// FIXME: It's not clear that a single instruction is an accurate model for
- // the inline cost of a cleanupret instruction.
+ // the inline cost of a catchret instruction.
return false;
}
continue;
// Skip ephemeral values.
- if (EphValues.count(I))
+ if (EphValues.count(&*I))
continue;
++NumInstructions;
if (isa<ExtractElementInst>(I) || I->getType()->isVectorTy())
++NumVectorInstructions;
- // If the instruction is floating point, and the target says this operation is
- // expensive or the function has the "use-soft-float" attribute, this may
- // eventually become a library call. Treat the cost as such.
+ // If the instruction is floating point, and the target says this operation
+ // is expensive or the function has the "use-soft-float" attribute, this may
+ // eventually become a library call. Treat the cost as such.
if (I->getType()->isFloatingPointTy()) {
bool hasSoftFloatAttr = false;
- // If the function has the "use-soft-float" attribute, mark it as expensive.
+ // If the function has the "use-soft-float" attribute, mark it as
+ // expensive.
if (F.hasFnAttribute("use-soft-float")) {
Attribute Attr = F.getFnAttribute("use-soft-float");
StringRef Val = Attr.getValueAsString();
// all of the per-instruction logic. The visit tree returns true if we
// consumed the instruction in any way, and false if the instruction's base
// cost should count against inlining.
- if (Base::visit(I))
+ if (Base::visit(&*I))
++NumInstructionsSimplified;
else
Cost += InlineConstants::InstrCost;
FAI != FAE; ++FAI, ++CAI) {
assert(CAI != CS.arg_end());
if (Constant *C = dyn_cast<Constant>(CAI))
- SimplifiedValues[FAI] = C;
+ SimplifiedValues[&*FAI] = C;
Value *PtrArg = *CAI;
if (ConstantInt *C = stripAndComputeInBoundsConstantOffsets(PtrArg)) {
- ConstantOffsetPtrs[FAI] = std::make_pair(PtrArg, C->getValue());
+ ConstantOffsetPtrs[&*FAI] = std::make_pair(PtrArg, C->getValue());
// We can SROA any pointer arguments derived from alloca instructions.
if (isa<AllocaInst>(PtrArg)) {
- SROAArgValues[FAI] = PtrArg;
+ SROAArgValues[&*FAI] = PtrArg;
SROAArgCosts[PtrArg] = 0;
}
}
else if (NumVectorInstructions <= NumInstructions / 2)
Threshold -= (FiftyPercentVectorBonus - TenPercentVectorBonus);
- return Cost < Threshold;
+ return Cost <= std::max(0, Threshold);
}
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
if (isa<IndirectBrInst>(BI->getTerminator()) || BI->hasAddressTaken())
return false;
- for (BasicBlock::iterator II = BI->begin(), IE = BI->end(); II != IE;
- ++II) {
- CallSite CS(II);
+ for (auto &II : *BI) {
+ CallSite CS(&II);
if (!CS)
continue;