This patch replaces some llvm::find with llvm::is_contained, it should be more clear.
Differential Revision: https://reviews.llvm.org/D127077
continue;
SmallVector<OpResult> aliasingOpResults =
bufferizableOp.getAliasingOpResult(opOperand, state);
- if (llvm::find(aliasingOpResults, opResult)
- != aliasingOpResults.end())
+ if (llvm::is_contained(aliasingOpResults, opResult))
result.push_back(&opOperand);
}
return result;
// Detect whether the comparison is less-than or greater-than, otherwise bail.
bool isLess;
- if (llvm::find(lessThanPredicates, compare.getPredicate()) !=
- lessThanPredicates.end()) {
+ if (llvm::is_contained(lessThanPredicates, compare.getPredicate())) {
isLess = true;
- } else if (llvm::find(greaterThanPredicates, compare.getPredicate()) !=
- greaterThanPredicates.end()) {
+ } else if (llvm::is_contained(greaterThanPredicates,
+ compare.getPredicate())) {
isLess = false;
} else {
return false;
[&](Operation *op) {
// Filter may be specified via options.
if (this->dialectFilter.hasValue())
- return llvm::find(this->dialectFilter,
- op->getDialect()->getNamespace()) !=
- this->dialectFilter.end();
+ return llvm::is_contained(this->dialectFilter,
+ op->getDialect()->getNamespace());
// No filter specified: All other ops are allowed.
return true;
};
if (!innerOp)
return failure();
- auto hasVal = [](const auto &range, Value val) {
- return llvm::find(range, val) != range.end();
- };
-
for (auto val : outerBody.getArguments())
- if (hasVal(innerOp.getLowerBound(), val) ||
- hasVal(innerOp.getUpperBound(), val) ||
- hasVal(innerOp.getStep(), val))
+ if (llvm::is_contained(innerOp.getLowerBound(), val) ||
+ llvm::is_contained(innerOp.getUpperBound(), val) ||
+ llvm::is_contained(innerOp.getStep(), val))
return failure();
// Reductions are not supported yet.
// Find all iteration variables among `minOp`'s operands add constrain them.
for (Value operand : operands) {
// Skip duplicate ivs.
- if (llvm::find(allIvs, operand) != allIvs.end())
+ if (llvm::is_contained(allIvs, operand))
continue;
// If `operand` is an iteration variable: Find corresponding loop