[all-commits] [llvm/llvm-project] b0761b: [DependenceAnalysis] Memory dependence analysis in...

ebrevnov via All-commits all-commits at lists.llvm.org
Fri Feb 21 05:21:03 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b0761bbc7639d0901d623e1fbf53ccf6ce066b16
      https://github.com/llvm/llvm-project/commit/b0761bbc7639d0901d623e1fbf53ccf6ce066b16
  Author: Evgeniy Brevnov <evgueni.brevnov at gmail.com>
  Date:   2020-02-21 (Fri, 21 Feb 2020)

  Changed paths:
    M llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
    M llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
    A llvm/test/Analysis/MemoryDependenceAnalysis/memdep_with_tbaa.ll

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

Summary:
There is a flaw in memory dependence analysis caching mechanism when memory accesses with TBAA are involved. Assume we first analysed and cached results for access with TBAA. Later we request dependence for the same memory but without TBAA (or different TBAA). By design these two queries should share one entry in the internal cache which corresponds to a general access (without TBAA).  Thus upon second request internal cached is cleared and we continue analysis for access as if there is no TBAA.

The problem is that even though internal cache is cleared the set of visited nodes is not. That means we won't traverse visited nodes again and populate internal cache with the corresponding dependence results. So we end up  with internal cache in an incomplete state. Current implementation tries to signal that situation by resetting CacheInfo->Pair at line 1104. But that doesn't actually help since later code ignores this invalidation and relies on 'Cache->empty()' property to decide on cache completeness.

Reviewers: reames, hfinkel, chandlerc, fedor.sergeev, asbirlea, fhahn, john.brawn, Prazek, sunfish

Reviewed By: john.brawn

Subscribers: DaniilSuchkov, kosarev, jfb, dantrushin, hiraditya, bmahjour, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73032




More information about the All-commits mailing list