[llvm] [ThinLTO] optimize propagateAttributes performance (PR #132917)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 25 09:08:59 PDT 2025


================
@@ -213,9 +211,10 @@ propagateAttributesToRefs(GlobalValueSummary *S,
   for (auto &VI : S->refs()) {
     assert(VI.getAccessSpecifier() == 0 || isa<FunctionSummary>(S));
     if (!VI.getAccessSpecifier()) {
-      if (!MarkedNonReadWriteOnly.insert(VI).second)
+      if (VI.getRef()->second.MarkedNonReadWriteOnly)
         continue;
-    } else if (MarkedNonReadWriteOnly.contains(VI))
----------------
teresajohnson wrote:

I would add an assert in the else case though to confirm this assumption (that MarkedNonReadWriteOnly.contains(VI) is false).

https://github.com/llvm/llvm-project/pull/132917


More information about the llvm-commits mailing list