[Mlir-commits] [mlir] 9136b7d - [mlir] AsyncRefCounting: check that LivenessBlockInfo is not nullptr

Eugene Zhulenev llvmlistbot at llvm.org
Thu May 27 10:54:34 PDT 2021


Author: Eugene Zhulenev
Date: 2021-05-27T10:54:21-07:00
New Revision: 9136b7d075d26a04db9dfed43c37e4c05cd3ccff

URL: https://github.com/llvm/llvm-project/commit/9136b7d075d26a04db9dfed43c37e4c05cd3ccff
DIFF: https://github.com/llvm/llvm-project/commit/9136b7d075d26a04db9dfed43c37e4c05cd3ccff.diff

LOG: [mlir] AsyncRefCounting: check that LivenessBlockInfo is not nullptr

Differential Revision: https://reviews.llvm.org/D103270

Added: 
    

Modified: 
    mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
index b73ecc891b06..15fd4f3f8765 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
@@ -278,7 +278,7 @@ AsyncRuntimeRefCountingPass::addDropRefInDivergentLivenessSuccessor(
     const LivenessBlockInfo *blockLiveness = liveness.getLiveness(&block);
 
     // Skip the block if value is not in the `liveOut` set.
-    if (!blockLiveness->isLiveOut(value))
+    if (!blockLiveness || !blockLiveness->isLiveOut(value))
       continue;
 
     BlockSet liveInSuccessors;   // `value` is in `liveIn` set
@@ -287,7 +287,7 @@ AsyncRuntimeRefCountingPass::addDropRefInDivergentLivenessSuccessor(
     // Collect successors that do not have `value` in the `liveIn` set.
     for (Block *successor : block.getSuccessors()) {
       const LivenessBlockInfo *succLiveness = liveness.getLiveness(successor);
-      if (succLiveness->isLiveIn(value))
+      if (succLiveness && succLiveness->isLiveIn(value))
         liveInSuccessors.insert(successor);
       else
         noLiveInSuccessors.insert(successor);


        


More information about the Mlir-commits mailing list