[llvm] [LAA] Avoid duplicate runtime-check group members (PR #226829)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 05:20:50 PDT 2026


================
@@ -736,21 +736,21 @@ void RuntimePointerChecking::groupChecks(
 
   unsigned TotalComparisons = 0;
 
-  DenseMap<Value *, SmallVector<unsigned>> PositionMap;
-  for (unsigned Index = 0; Index < Pointers.size(); ++Index)
-    PositionMap[Pointers[Index].PointerValue].push_back(Index);
+  DenseMap<Value *, SmallVector<unsigned>> PointerToIndices;
----------------
fhahn wrote:

Could we avoid to add duplicates in the first place, by adjusting the map to be keyed by MemAccessInfo, which also tracks read/write?

```suggestion
  DenseMap<MemoryDepChecker::MemAccessInfo, SmallVector<unsigned>> PointerToIndices;
```

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


More information about the llvm-commits mailing list