/// Remove all instances of I from the worklist vector specified.
static void removeFromWorklist(Instruction *I,
std::vector<Instruction *> &Worklist) {
-
- Worklist.erase(std::remove(Worklist.begin(), Worklist.end(), I),
- Worklist.end());
+ llvm::erase_value(Worklist, I);
}
/// When we find that I really equals V, remove I from the
if (MergeBlockIntoPredecessor(Dest, &DTU, LI)) {
// Dest has been folded into Fold. Update our worklists accordingly.
std::replace(Latches.begin(), Latches.end(), Dest, Fold);
- UnrolledLoopBlocks.erase(std::remove(UnrolledLoopBlocks.begin(),
- UnrolledLoopBlocks.end(), Dest),
- UnrolledLoopBlocks.end());
+ llvm::erase_value(UnrolledLoopBlocks, Dest);
}
}
}
static void
EliminateBlockCases(BasicBlock *BB,
std::vector<ValueEqualityComparisonCase> &Cases) {
- Cases.erase(std::remove(Cases.begin(), Cases.end(), BB), Cases.end());
+ llvm::erase_value(Cases, BB);
}
/// Return true if there are any keys in C1 that exist in C2 as well.
if (findBuildAggregate_rec(LastInsertInst, TTI, BuildVectorOpds, InsertElts,
0)) {
- llvm::erase_if(BuildVectorOpds,
- [](const Value *V) { return V == nullptr; });
- llvm::erase_if(InsertElts, [](const Value *V) { return V == nullptr; });
+ llvm::erase_value(BuildVectorOpds, nullptr);
+ llvm::erase_value(InsertElts, nullptr);
if (BuildVectorOpds.size() >= 2)
return true;
}