diff --git a/mlir/lib/Conversion/AIRToAIEPass.cpp b/mlir/lib/Conversion/AIRToAIEPass.cpp index 190fcfe56..f68933bde 100644 --- a/mlir/lib/Conversion/AIRToAIEPass.cpp +++ b/mlir/lib/Conversion/AIRToAIEPass.cpp @@ -3429,13 +3429,13 @@ class AIRLinalgOpToLibraryCallRewrite auto getLibFnOperands = [](linalg::LinalgOp op) { SmallVector operands; for (auto operand : op->getOperands()) { - if (auto operation = operand.getDefiningOp()) { - if (dyn_cast(operation) || - dyn_cast(operation) || - dyn_cast(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); }