[ScalarEvolution] Fix pointer/int confusion in howManyLessThans.
commit8f792707c4e5208bba08d837504c93de28b1f209
authorEli Friedman <efriedma@quicinc.com>
Wed, 8 Sep 2021 21:32:07 +0000 (8 14:32 -0700)
committerEli Friedman <efriedma@quicinc.com>
Thu, 9 Sep 2021 19:38:33 +0000 (9 12:38 -0700)
treeccb0d75ab22e7abf83025611c84b52039daa8f9a
parent89837a0e1b536c88651b9e68b73eda9c18659db2
[ScalarEvolution] Fix pointer/int confusion in howManyLessThans.

In general, howManyLessThans doesn't really want to work with pointers
at all; the result is an integer, and the operands of the icmp are
effectively integers.  However, isLoopEntryGuardedByCond doesn't like
extra ptrtoint casts, so the arguments to isLoopEntryGuardedByCond need
to be computed without those casts.

Somehow, the values got mixed up with the recent howManyLessThans
improvements; fix the confused values, and add a better comment to
explain what's happening.

Differential Revision: https://reviews.llvm.org/D109465
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll