[llvm] 53b6753 - [Attributor][FIX] Address two oversights in AAIsDead

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 23:26:47 PST 2022


Author: Johannes Doerfert
Date: 2022-02-01T01:18:51-06:00
New Revision: 53b6753bdde30e980f9482d2ec08221b70b9f88b

URL: https://github.com/llvm/llvm-project/commit/53b6753bdde30e980f9482d2ec08221b70b9f88b
DIFF: https://github.com/llvm/llvm-project/commit/53b6753bdde30e980f9482d2ec08221b70b9f88b.diff

LOG: [Attributor][FIX] Address two oversights in AAIsDead

No tests as these were found browsing the code and I'm not sure how to
test them properly.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index 417b77faf2f3..3ed034526b5c 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -3790,6 +3790,7 @@ struct AAIsDeadFunction : public AAIsDead {
       if (!AssumedLiveBlocks.count(&BB)) {
         A.deleteAfterManifest(BB);
         ++BUILD_STAT_NAME(AAIsDead, BasicBlock);
+        HasChanged = ChangeStatus::CHANGED;
       }
 
     return HasChanged;
@@ -3799,7 +3800,7 @@ struct AAIsDeadFunction : public AAIsDead {
   ChangeStatus updateImpl(Attributor &A) override;
 
   bool isEdgeDead(const BasicBlock *From, const BasicBlock *To) const override {
-    return !AssumedLiveEdges.count(std::make_pair(From, To));
+    return isValidState() && !AssumedLiveEdges.count(std::make_pair(From, To));
   }
 
   /// See AbstractAttribute::trackStatistics()


        


More information about the llvm-commits mailing list