[BasicAA] Fix a bug with relational reasoning across iterations
authorPhilip Reames <listmail@philipreames.com>
Sat, 5 Dec 2020 22:05:48 +0000 (14:05 -0800)
committerPhilip Reames <listmail@philipreames.com>
Sat, 5 Dec 2020 22:10:21 +0000 (14:10 -0800)
commitbfda69416c6d0a76b40644b1b0cbc1cbca254a61
tree51e8185c76bc6ae0de625626ab488ef1680a769d
parent13ee00d0c95a4eede96ba9520146a01930af2a0a
[BasicAA] Fix a bug with relational reasoning across iterations

Due to the recursion through phis basicaa does, the code needs to be extremely careful not to reason about equality between values which might represent distinct iterations. I'm generally skeptical of the correctness of the whole scheme, but this particular patch fixes one particular instance which is demonstrateable incorrect.

Interestingly, this appears to be the second attempted fix for the same issue. The former fix is incomplete and doesn't address the actual issue.

Differential Revision: https://reviews.llvm.org/D92694
llvm/include/llvm/Analysis/BasicAliasAnalysis.h
llvm/lib/Analysis/BasicAliasAnalysis.cpp
llvm/test/Analysis/BasicAA/phi-aa.ll