MLIR 22.0.0git
RootOrdering.cpp File Reference
#include "RootOrdering.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include <utility>

Go to the source code of this file.

Functions

static SmallVector< ValuegetCycle (const DenseMap< Value, Value > &parents, Value rep)
 Returns the cycle implied by the specified parent relation, starting at the given node.
static void contract (RootOrderingGraph &graph, ArrayRef< Value > cycle, const DenseMap< Value, unsigned > &parentDepths, DenseMap< Value, Value > &actualSource, DenseMap< Value, Value > &actualTarget)
 Contracts the specified cycle in the given graph in-place.

Function Documentation

◆ contract()

void contract ( RootOrderingGraph & graph,
ArrayRef< Value > cycle,
const DenseMap< Value, unsigned > & parentDepths,
DenseMap< Value, Value > & actualSource,
DenseMap< Value, Value > & actualTarget )
static

Contracts the specified cycle in the given graph in-place.

The parentsCost map specifies, for each node in the cycle, the lowest cost among the edges entering that node. Then, the nodes in the cycle C are replaced with a single node v_C (the first node in the cycle). All edges (u, v) entering the cycle, v \in C, are replaced with a single edge (u, v_C) with an appropriately chosen cost, and the selected node v is marked in the output map actualTarget[u]. All edges (u, v) leaving the cycle, u \in C, are replaced with a single edge (v_C, v), and the selected node u is marked in the ouptut map actualSource[v].

Definition at line 46 of file RootOrdering.cpp.

References target.

Referenced by contractSupportsMMAMatrixType(), getSubgroupMmaNativeVectorSize(), gpuMmaUnrollOrder(), inferFragType(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), mlir::pdl_to_pdl_interp::OptimalBranching::solve(), and supportsMMaMatrixType().

◆ getCycle()

SmallVector< Value > getCycle ( const DenseMap< Value, Value > & parents,
Value rep )
static

Returns the cycle implied by the specified parent relation, starting at the given node.

Definition at line 25 of file RootOrdering.cpp.

Referenced by mlir::pdl_to_pdl_interp::OptimalBranching::solve().