std::make_unique<SuccessNode>(list.pattern, list.root, std::move(node));
// If the pattern doesn't contain this predicate, ignore it.
- } else if (list.predicates.find(*current) == list.predicates.end()) {
+ } else if (!list.predicates.contains(*current)) {
propagatePattern(node, list, std::next(current), end);
// If the current matcher node is invalid, create a new one for this
ensureLaunchIndependent(cloningMap.lookupOrDefault(step))});
// todo(herhut,ravishankarm): Update the behavior of setMappingAttr
// when this condition is relaxed.
- if (bounds.find(processor) != bounds.end()) {
+ if (bounds.contains(processor)) {
return rewriter.notifyMatchFailure(
parallelOp, "cannot redefine the bound for processor " +
Twine(static_cast<int64_t>(processor)));
}
// Everything else (including compute ops and dma finish) are shifted by one.
for (auto &op : forOp.getBody()->without_terminator())
- if (instShiftMap.find(&op) == instShiftMap.end())
+ if (!instShiftMap.contains(&op))
instShiftMap[&op] = 1;
// Get shifts stored in map.
for (unsigned i = 0; i < sourceShape.size(); i++) {
int64_t dimShape = sourceShape[i];
AffineExpr dimExpr = sourceMap.getResult(i);
- if (affineExprToSize.find(dimExpr) == affineExprToSize.end() ||
+ if (!affineExprToSize.contains(dimExpr) ||
!sourceType.isDynamicDim(i)) {
newShape.push_back(dimShape);
continue;
// All operations need to have a stage.
for (Operation &op : forOp.getBody()->without_terminator()) {
- if (stages.find(&op) == stages.end()) {
+ if (!stages.contains(&op)) {
op.emitOpError("not assigned a pipeline stage");
return false;
}
if (llvm::any_of(forOp.getBody()->getTerminator()->getOperands(),
[this](Value operand) {
Operation *def = operand.getDefiningOp();
- return !def || stages.find(def) == stages.end();
+ return !def || !stages.contains(def);
}))
return false;
annotateFn = options.annotateFn;
auto verifyTraitValidity = [&](Record *trait) {
auto *dependentTraits = trait->getValueAsListInit("dependentTraits");
for (auto *traitInit : *dependentTraits)
- if (traitSet.find(traitInit) == traitSet.end())
+ if (!traitSet.contains(traitInit))
PrintFatalError(
def.getLoc(),
trait->getValueAsString("trait") + " requires " +