This is an archive of the discontinued LLVM Phabricator instance.

[ScalarEvolution] Fix pointer/int confusion in howManyLessThans.
ClosedPublic

Authored by efriedma on Sep 8 2021, 2:39 PM.

Details

Summary

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.

Diff Detail

Event Timeline

efriedma created this revision.Sep 8 2021, 2:39 PM
efriedma requested review of this revision.Sep 8 2021, 2:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2021, 2:39 PM
reames accepted this revision.Sep 9 2021, 10:02 AM

LGTM

This revision is now accepted and ready to land.Sep 9 2021, 10:02 AM