From 531ee50227e436b274264a79461ec6a177550160 Mon Sep 17 00:00:00 2001 From: Abhishek Varma Date: Wed, 29 Jan 2025 14:46:05 +0000 Subject: [PATCH] Review comment v5.0 --- .../IR/AMDAIELogicalObjFifoOpInterface.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIELogicalObjFifoOpInterface.cpp b/compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIELogicalObjFifoOpInterface.cpp index 89fb8b57a..65434469d 100644 --- a/compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIELogicalObjFifoOpInterface.cpp +++ b/compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIELogicalObjFifoOpInterface.cpp @@ -17,10 +17,10 @@ SmallVector getCopyLikeConsumers( LogicalObjFifoOpInterface op) { SmallVector copyLikOps; for (Operation *userOp : op->getUsers()) { - if (auto copyOp = dyn_cast(userOp)) { - if (dyn_cast_if_present( - copyOp.getSource().getDefiningOp()) == op) - copyLikOps.push_back(copyOp); + if (auto copyOp = dyn_cast(userOp); + copyOp && dyn_cast_if_present( + copyOp.getSource().getDefiningOp()) == op) { + copyLikOps.push_back(copyOp); } } return copyLikOps; @@ -30,10 +30,10 @@ SmallVector getCopyLikeProducers( LogicalObjFifoOpInterface op) { SmallVector copyLikOps; for (Operation *userOp : op->getUsers()) { - if (auto copyOp = dyn_cast(userOp)) { - if (dyn_cast_if_present( - copyOp.getTarget().getDefiningOp()) == op) - copyLikOps.push_back(copyOp); + if (auto copyOp = dyn_cast(userOp); + copyOp && dyn_cast_if_present( + copyOp.getTarget().getDefiningOp()) == op) { + copyLikOps.push_back(copyOp); } } return copyLikOps;