================
@@ -910,6 +910,8 @@ template <typename T>
 static llvm::ImmutableSet<T> join(llvm::ImmutableSet<T> A,
                                   llvm::ImmutableSet<T> B,
                                   typename llvm::ImmutableSet<T>::Factory &F) {
+  if (A == B)
+    return A;
----------------
jvoung wrote:

would the `add()` on line 918 also possibly do more allocation than desired 
(and cost more than checking if contains first), if `E` was already in `A` ?

https://github.com/llvm/llvm-project/pull/159582
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to