================
@@ -27,9 +27,13 @@ static bool areEquivalentIndirectionValues(const Value &Val1,
 }
 
 bool areEquivalentValues(const Value &Val1, const Value &Val2) {
-  return &Val1 == &Val2 || (Val1.getKind() == Val2.getKind() &&
-                            (isa<TopBoolValue>(&Val1) ||
-                             areEquivalentIndirectionValues(Val1, Val2)));
+  // If values are distinct and have properties, we don't consider them equal,
+  // leaving equality up to the user model.
+  return &Val1 == &Val2 ||
+         (Val1.getKind() == Val2.getKind() &&
+          (Val1.properties().empty() && Val2.properties().empty()) &&
----------------
ymand wrote:

I think so, based on our experience with Nullability.  This could arise because 
a pointer on one branch was (somehow) unannotated with properties while the 
other branch was modeled fully. So, at the join, we want the analysis to see 
both and decide how to proceed. If we mark them equivalent, the analysis's join 
(aka `merge`) doesn't see them and it doesn't even get to choose which one is 
retained (it will depend arbitrarily on whether it came from the left or right).

https://github.com/llvm/llvm-project/pull/76746
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to