[PATCH] D73032: [DependenceAnalysis] Memory dependence analysis internal caching mechanism is broken in presence of TBAA (PR42733).

Evgeniy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 02:56:13 PST 2020


ebrevnov marked an inline comment as done.
ebrevnov added inline comments.


================
Comment at: llvm/lib/Analysis/MemoryDependenceAnalysis.cpp:1173
+    // incomplete, the result will be valid cache info, otherwise it isn't.
+    if (!IsIncomplete && Cache->empty())
       CacheInfo->Pair = BBSkipFirstBlockPair(StartBB, SkipFirstBlock);
----------------
dantrushin wrote:
> ebrevnov wrote:
> > dantrushin wrote:
> > > This is confusing. How can empty cache be incomplete? Can valid cache be incomplete? Invalid cache?
> > > 
> > > Also, can we make it part of cache API, not external entity?
> > > 
> > > 
> > > This is confusing. How can empty cache be incomplete? Can valid cache be incomplete? Invalid cache?
> > One way to think about it is as of two level cache. Second level cache doesn't know anything about first level cache. It always by design contains valid information. Thus empty cache is always valid since it doesn't contain any wrong data. But from the point of first level cache second level cache is "incomplete" if it doesn't contain all the required information. Hopefully that description helps... at least a bit :-)
> > 
> > > Also, can we make it part of cache API, not external entity?
> > Could you clarify?
> `Cache->incomplete()` or something like that
Essentially, we already have this facility. This is done by setting and resetting BB in CacheInfo->Pair.
In our case "isIncomplete" signals local state of the cache which is used to calculate actual state of the cache. Even though it's possible to carry local state with the cache I think it makes sense to do as it may cause confusion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73032





More information about the llvm-commits mailing list