[PATCH] D134704: [AAPointerInfo] Distinguish initial from unknown OffsetInfo

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 06:33:13 PDT 2022


jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

Some minor nits inlined. Also, (1) can we have a pure Attributor test for this? And, (2) can you describe the issue in the commit message a bit.

I'm not 100% sure about the impact on other Unkown uses but it's probably fine. We can also port some to Unassigned later.

LG, see above.



================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:5072
+    static constexpr int64_t Unassigned = -1;
+    static constexpr int64_t Unknown = -2;
   };
----------------
Nit: Update the comment too.


================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:1246
                                      bool &Follow) {
+      assert(PtrOI.Offset != OffsetAndSize::Unassigned);
       OffsetInfo &UsrOI = OffsetInfoMap[Usr];
----------------
Please add messages to all assertions, also below.


================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:1321
+          Follow = UsrOI.Offset == OffsetAndSize::Unassigned ||
+                   UsrOI.Offset != OffsetAndSize::Unknown;
           UsrOI = PtrOI;
----------------
Isn't this just `UsrOI.Offset != Unknown`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134704/new/

https://reviews.llvm.org/D134704



More information about the llvm-commits mailing list