[ScalarEvolution] Clarify implementation of getPointerBase().
authorEli Friedman <efriedma@quicinc.com>
Wed, 23 Jun 2021 19:46:57 +0000 (12:46 -0700)
committerEli Friedman <efriedma@quicinc.com>
Wed, 23 Jun 2021 19:55:59 +0000 (12:55 -0700)
commitb12192f7cd8c12898c161c573aad41ac65721c80
treed3f8677fc4c54fed9b4bea6bd1f3da94a41d4c3d
parentfdaf304e0d984c9f919c6b6b2b108d0d31cbea87
[ScalarEvolution] Clarify implementation of getPointerBase().

getPointerBase should only be looking through Add and AddRec
expressions; other expressions either aren't pointers, or can't be
looked through.

Technically, this is a functional change. For a multiply or min/max
expression, if they have exactly one pointer operand, and that operand
is the first operand, the behavior here changes. Similarly, if an AddRec
has a pointer-type step, the behavior changes. But that shouldn't be
happening in practice, and we plan to make such expressions illegal.
llvm/lib/Analysis/ScalarEvolution.cpp