[BasicAA] Fix recursive phi MustAlias calculations
authorDavid Green <david.green@arm.com>
Thu, 2 Jul 2020 09:56:58 +0000 (10:56 +0100)
committerDavid Green <david.green@arm.com>
Thu, 2 Jul 2020 13:01:38 +0000 (14:01 +0100)
commit30bd66544d7a1e602dfaf412158d4bd759352e36
tree54fd9ff1c6c970696d588ab1ff8d3952f7e09e88
parent8c5133f1855767a16a6045777bed4652bd114d84
[BasicAA] Fix recursive phi MustAlias calculations

With the option -basic-aa-recphi we can detect recursive phis that loop
through constant geps, which allows us to detect more no-alias case for
pointer IV's. If the other phi operand and the other alias value are
MustAlias though, we cannot presume that every element in the loop is
also MustAlias. We need to instead be conservative and return MayAlias.

Differential Revision: https://reviews.llvm.org/D82987
llvm/lib/Analysis/BasicAliasAnalysis.cpp
llvm/test/Analysis/BasicAA/recphi.ll