[llvm] [Attributor]: allow more than one offset for a pass through user in AAPointerInfo (PR #94416)

Joachim Meyer via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 09:55:20 PDT 2024


================
@@ -1607,11 +1607,19 @@ ChangeStatus AAPointerInfoFloating::updateImpl(Attributor &A) {
     //
     // The RHS is a reference that may be invalidated by an insertion caused by
     // the LHS. So we ensure that the side-effect of the LHS happens first.
+
+    if (!OffsetInfoMap.contains(Usr)) {
+      auto &PtrOI = OffsetInfoMap[CurPtr];
+      OffsetInfoMap.insert(std::make_pair(Usr, PtrOI));
----------------
fodinabor wrote:

Isn't this doing exactly what the comment above says to not do?
I.e. you're using another way of writing `OffsetInfoMap[Usr] = OffsetInfoMap[CurPtr]`.

```suggestion
      auto &UsrOI = OffsetInfoMap[Usr];
      auto &PtrOI = OffsetInfoMap[CurPtr];
      UsrOI = PtrOI;
```


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


More information about the llvm-commits mailing list