[llvm] [polly] [AST] Don't merge memory locations in AliasSetTracker (PR #65731)

Bruno De Fraine via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 04:51:48 PST 2023


================
@@ -307,7 +173,7 @@ class AliasSetTracker {
   BatchAAResults &AA;
   ilist<AliasSet> AliasSets;
 
-  using PointerMapType = DenseMap<AssertingVH<Value>, AliasSet::PointerRec *>;
+  using PointerMapType = DenseMap<MemoryLocation, AliasSet *>;
----------------
brunodf-snps wrote:

> I don't really get why this needs to be indexed by MemoryLocation [...] it seems like the existing indexing should work fine...

I still tried this, see [this branch](https://github.com/brunodf-snps/llvm-project/tree/ast-pointer-map). The pointer map can be smaller, but this is traded for extra work in `AliasSetTracker::getAliasSetFor`, see commit 23443f3. It turns out that two memory locations for the same `UndefValue` **do** end up in different alias sets (see [this BasicAA logic](https://github.com/llvm/llvm-project/blob/92fc4b482f58cb243d982d572adb7a80ceab6945/llvm/lib/Analysis/BasicAliasAnalysis.cpp#L1472-L1475)) so I have to exclude them from the pointer map, which complicate the logic. On the plus side, a lots of tests can be reverted, see commit 92f01a2, since we can restore the "pointer values" output in the alias set dump, but I don't know if that is much of an argument.

Let me know if you consider the version on the branch an improvement, then I will include it in this pull request.

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


More information about the llvm-commits mailing list