#include "mlir/Analysis/TopologicalSortUtils.h"
#include "mlir/IR/Block.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/RegionGraphTraits.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SetVector.h"
usingnamespacemlir;
static bool isOpReady(Operation *op, DenseSet<Operation *> &unscheduledOps,
function_ref<bool(Value, Operation *)> isOperandReady) { … }
bool mlir::sortTopologically(
Block *block, llvm::iterator_range<Block::iterator> ops,
function_ref<bool(Value, Operation *)> isOperandReady) { … }
bool mlir::sortTopologically(
Block *block, function_ref<bool(Value, Operation *)> isOperandReady) { … }
bool mlir::computeTopologicalSorting(
MutableArrayRef<Operation *> ops,
function_ref<bool(Value, Operation *)> isOperandReady) { … }
SetVector<Block *> mlir::getBlocksSortedByDominance(Region ®ion) { … }
namespace {
class TopoSortHelper { … };
}
SetVector<Operation *>
mlir::topologicalSort(const SetVector<Operation *> &toSort) { … }