[PATCH] D141164: [AAUnderlyingObjects] Introduce an AA for getting underlying objects of a pointer

Shilei Tian via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 7 17:33:50 PST 2023


tianshilei1992 added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:11289
+                                         ? InterAssumedUnderlyingObjects
+                                         : IntraAssumedUnderlyingObjects;
+    for (Value *Obj : AssumedUnderlyingObjects)
----------------
jdoerfert wrote:
> Scope can be Any. Use Intra for Intra and Inter otherwise. Maybe track what was requested so you don't eagerly compute both?
`forallUnderlyingObjects` will be called after the execution of AA. We don't know the scope when we create the AA. Maybe we want to have something like the following?
```
template <AA::ValueScope Scope>
struct AAUnderlyingObjects {
  // ...
};

using AAIntraUnderlyingObjects = AAUnderlyingObjects<AA::Intraprocedural>;
using AAInterUnderlyingObjects = AAUnderlyingObjects<AA::Interprocedural>;
using AAAnyUnderlyingObjects = AAUnderlyingObjects<AA::Any>;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141164



More information about the llvm-commits mailing list