llvm/mlir/lib/Dialect/Affine/Analysis/NestedMatcher.cpp

//===- NestedMatcher.cpp - NestedMatcher Impl  ----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include <utility>

#include "mlir/Dialect/Affine/Analysis/NestedMatcher.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/raw_ostream.h"

usingnamespacemlir;
usingnamespacemlir::affine;

llvm::BumpPtrAllocator *&NestedMatch::allocator() {}

NestedMatch NestedMatch::build(Operation *operation,
                               ArrayRef<NestedMatch> nestedMatches) {}

llvm::BumpPtrAllocator *&NestedPattern::allocator() {}

void NestedPattern::copyNestedToThis(ArrayRef<NestedPattern> nested) {}

void NestedPattern::freeNested() {}

NestedPattern::NestedPattern(ArrayRef<NestedPattern> nested,
                             FilterFunctionType filter)
    :{}

NestedPattern::NestedPattern(const NestedPattern &other)
    :{}

NestedPattern &NestedPattern::operator=(const NestedPattern &other) {}

unsigned NestedPattern::getDepth() const {}

/// Matches a single operation in the following way:
///   1. checks the kind of operation against the matcher, if different then
///      there is no match;
///   2. calls the customizable filter function to refine the single operation
///      match with extra semantic constraints;
///   3. if all is good, recursively matches the nested patterns;
///   4. if all nested match then the single operation matches too and is
///      appended to the list of matches;
///   5. TODO: Optionally applies actions (lambda), in which case we will want
///      to traverse in post-order DFS to avoid invalidating iterators.
void NestedPattern::matchOne(Operation *op,
                             SmallVectorImpl<NestedMatch> *matches) {}

static bool isAffineForOp(Operation &op) {}

static bool isAffineIfOp(Operation &op) {}

namespace mlir {
namespace affine {
namespace matcher {

NestedPattern Op(FilterFunctionType filter) {}

NestedPattern If(const NestedPattern &child) {}
NestedPattern If(const FilterFunctionType &filter, const NestedPattern &child) {}
NestedPattern If(ArrayRef<NestedPattern> nested) {}
NestedPattern If(const FilterFunctionType &filter,
                 ArrayRef<NestedPattern> nested) {}

NestedPattern For(const NestedPattern &child) {}
NestedPattern For(const FilterFunctionType &filter,
                  const NestedPattern &child) {}
NestedPattern For(ArrayRef<NestedPattern> nested) {}
NestedPattern For(const FilterFunctionType &filter,
                  ArrayRef<NestedPattern> nested) {}

bool isLoadOrStore(Operation &op) {}

} // namespace matcher
} // namespace affine
} // namespace mlir