[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 Jan 9 02:45:17 PST 2024


================
@@ -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:

It is true that both NoAlias and MustAlias are correct results here and you can choose which one to pick, but my reasoning was that AA already picks NoAlias and so I attempted to represent the same thing in AST (when I say I strive for no information loss, I essentially mean that AST should construct alias sets consistent with AA results -- the motivating example is a case where AA is indicating NoAlias, and current AST is ending up with MayAlias due to implementation organization).

But I am fine with an implementation where all MemoryLocations for the same pointer Value are by construction in the same AliasSet, i.e. where the PointerMap stays. The discussion has shown that the impact is only for undef pointer values, and I expect the difference is of very little practical relevance (as you basically write, creating a new set for every undef pointer does not seem to have added value). So I have merged my ast-pointer-map branch into this PR now, so the combined set of changes that I propose is visible here, and we can move forward with that.

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


More information about the llvm-commits mailing list