[PATCH] Analyze recursive PHI nodes in BasicAA

Sanjoy Das sanjoy at playingwithpointers.com
Thu Jun 25 14:15:17 PDT 2015

I'm a tad concerned about the use of undef in this change.  If I
understand the change correctly, it looks like you're using undef as
"any arbitrary value that the compiler cannot reason about" when it
really is "any arbitrary value of the compiler's choice".

For instance, if you're trying to check if "PN = PHI(GEP(PN, 1), V)"
aliases with "GEP(V, 1)" (the correct result here is MayAlias) then
you'll return NoAlias if "V NoAlias GEP(V, 1)" && "V NoAlias GEP(V,
undef)".  The first clause is true today, and depending on how
aggressive -basicaa becomes about exploiting undef, the second clause
may be taken to be true as well (today it is false).  e.g. -basicaa
today will return NoAlias for (X, undef) for any X; and "X NoAlias
(GEP(V, undef))" is a very similar concept.



More information about the llvm-commits mailing list