Skip to content

Commit

Permalink
Replace dyn_casts with isa_and_present
Browse files Browse the repository at this point in the history
  • Loading branch information
akkothar authored Aug 7, 2024
1 parent eccc213 commit 369a1e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mlir/lib/Conversion/AIRToAIEPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3429,13 +3429,13 @@ class AIRLinalgOpToLibraryCallRewrite
auto getLibFnOperands = [](linalg::LinalgOp op) {
SmallVector<Value> operands;
for (auto operand : op->getOperands()) {
if (auto operation = operand.getDefiningOp()) {
if (dyn_cast<memref::ReshapeOp>(operation) ||
dyn_cast<memref::ExpandShapeOp>(operation) ||
dyn_cast<memref::CollapseShapeOp>(operation)) {
auto operation = operand.getDefiningOp();
if (isa_and_present<
memref::ReshapeOp,
memref::ExpandShapeOp,
memref::CollapseShapeOp>(operation)) {
operands.push_back(operation->getOperand(0));
continue;
}
}
operands.push_back(operand);
}
Expand Down

0 comments on commit 369a1e2

Please sign in to comment.