diff --git a/mlir/lib/Transform/AIRDependencyScheduleOpt.cpp b/mlir/lib/Transform/AIRDependencyScheduleOpt.cpp
index 17b23a5de..64a10c413 100644
--- a/mlir/lib/Transform/AIRDependencyScheduleOpt.cpp
+++ b/mlir/lib/Transform/AIRDependencyScheduleOpt.cpp
@@ -2161,10 +2161,6 @@ struct BroadcastDetection {
                              .getType()
                              .cast<MemRefType>()
                              .getMemorySpaceAsInt();
-      int dst_memspace = dma_op.getDstMemref()
-                             .getType()
-                             .cast<MemRefType>()
-                             .getMemorySpaceAsInt();
       auto externalOffsets = src_memspace == (int)air::MemorySpace::L1
                                  ? dma_op.getDstOffsets()
                                  : dma_op.getSrcOffsets();