[DependenceAnalysis] Dependecies for loads marked with "ivnariant.load" should not...
authorEvgeniy Brevnov <evgueni.brevnov@gmail.com>
Tue, 19 Nov 2019 10:26:24 +0000 (17:26 +0700)
committerEvgeniy Brevnov <evgueni.brevnov@gmail.com>
Tue, 19 Nov 2019 10:30:02 +0000 (17:30 +0700)
commit5f026b6d9e882941fde9b7e5dc0a2d807f7f24f5
treeb661a10ce26c6afa8d9d66de287d1744587abf2e
parentb6d7bbfa004310777cd41448ffc377aea082fc8c
[DependenceAnalysis] Dependecies for loads marked with "ivnariant.load" should not be shared with general accesses. Fix for https://bugs.llvm.org/show_bug.cgi?id=42151

Summary:
Dependence anlysis has a mechanism to cache results. Thus for particular memory access the cache keep track of side effects in basic blocks. The problem is that for invariant loads dependepce analysis legally ignores many dependencies due to a special semantic rules for such loads. But later results calculated for invariant load retrived from the cache for general case acceses. As a result we have wrong dependence information causing GVN to do illegal transformation. Fixes, T42151.

Proposed solution is to disable caching of invariant loads. I think such loads a pretty rare and it doesn't make sense to extend caching mechanism for them.

Reviewers: reames, chandlerc, skatkov, morisset, jdoerfert

Reviewed By: reames

Subscribers: hiraditya, test, jdoerfert, lebedev.ri, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64405
llvm/lib/Analysis/MemoryDependenceAnalysis.cpp