[llvm] de88628 - [Attributor][FIX] Ensure AAAssumptionInfo properly reports change

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 12:32:56 PDT 2023


Author: Johannes Doerfert
Date: 2023-06-29T12:32:45-07:00
New Revision: de88628ab92695a737bb75dbefb1b652d602f9e2

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

LOG: [Attributor][FIX] Ensure AAAssumptionInfo properly reports change

I have no test as I just noticed the wrong change status reported by
update randomly.

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/IPO/Attributor.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 3282de6911e75..12784b87a7524 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -3069,6 +3069,7 @@ template <typename BaseTy> struct SetState : public AbstractState {
   /// Performs the set intersection between this set and \p RHS. Returns true if
   /// changes were made.
   bool getIntersection(const SetContents &RHS) {
+    bool IsUniversal = Assumed.isUniversal();
     unsigned SizeBefore = Assumed.getSet().size();
 
     // Get intersection and make sure that the known set is still a proper
@@ -3076,7 +3077,8 @@ template <typename BaseTy> struct SetState : public AbstractState {
     Assumed.getIntersection(RHS);
     Assumed.getUnion(Known);
 
-    return SizeBefore != Assumed.getSet().size();
+    return SizeBefore != Assumed.getSet().size() ||
+           IsUniversal != Assumed.isUniversal();
   }
 
   /// Performs the set union between this set and \p RHS. Returns true if


        


More information about the llvm-commits mailing list