Skip to content

Commit

Permalink
Fixup logic around checking for pure memref.store; it shouldn't requi…
Browse files Browse the repository at this point in the history
…re getting its memref's defining op (Xilinx#776)
  • Loading branch information
erwei-xilinx authored Nov 16, 2024
1 parent e1569fc commit cb7758b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions mlir/lib/Transform/AIRDependency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,9 @@ class AIRDependency
}
// If a memref store is storing to an alloca for shape,
// it must not be executed.
if (auto storeOp = dyn_cast<memref::StoreOp>(op)) {
if (auto memalloc_op = dyn_cast<memref::AllocOp>(
storeOp.getMemRef().getDefiningOp())) {
assert(memalloc_op->getNumResults() == 1 &&
"Number of results of alloc op == 1");
if (alloc_for_reshape(memalloc_op->getOpResult(0)))
isCandidateExecute = false;
}
}
if (auto storeOp = dyn_cast<memref::StoreOp>(op))
if (alloc_for_reshape(storeOp.getMemRef()))
isCandidateExecute = false;
// No air execute for expand, collapse and reshape ops
if (isa_and_present<memref::ReshapeOp, memref::ExpandShapeOp,
memref::CollapseShapeOp>(op)) {
Expand Down

0 comments on commit cb7758b

Please sign in to comment.