Changeset View
Changeset View
Standalone View
Standalone View
mlir/lib/Analysis/SliceAnalysis.cpp
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
static void getBackwardSliceImpl(Operation *op, | static void getBackwardSliceImpl(Operation *op, | ||||
SetVector<Operation *> *backwardSlice, | SetVector<Operation *> *backwardSlice, | ||||
TransitiveFilter filter) { | TransitiveFilter filter) { | ||||
if (!op) | if (!op) | ||||
return; | return; | ||||
assert((op->getNumRegions() == 0 || | assert((op->getNumRegions() == 0 || | ||||
isa<AffineForOp, scf::ForOp, linalg::LinalgOp, linalg::PadTensorOp>( | isa<AffineForOp, scf::ForOp, linalg::LinalgOp>(op)) && | ||||
op)) && | |||||
"unexpected generic op with regions"); | "unexpected generic op with regions"); | ||||
// Evaluate whether we should keep this def. | // Evaluate whether we should keep this def. | ||||
// This is useful in particular to implement scoping; i.e. return the | // This is useful in particular to implement scoping; i.e. return the | ||||
// transitive forwardSlice in the current scope. | // transitive forwardSlice in the current scope. | ||||
if (!filter(op)) { | if (!filter(op)) { | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |