This is an archive of the discontinued LLVM Phabricator instance.

[ScalarEvolution] Make sure getMinusSCEV doesn't negate pointers.
ClosedPublic

Authored by efriedma on Jul 6 2021, 11:00 AM.

Details

Summary

Add a function removePointerBase that returns, essentially, S - getPointerBase(S). Use it in getMinusSCEV instead of multiplying a pointer by -1.

Diff Detail

Event Timeline

efriedma created this revision.Jul 6 2021, 11:00 AM
efriedma requested review of this revision.Jul 6 2021, 11:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2021, 11:00 AM
mkazantsev added inline comments.Jul 7 2021, 1:19 AM
llvm/lib/Analysis/ScalarEvolution.cpp
4163

I guess you forgot to modify ops somewhere.

mkazantsev accepted this revision.Jul 7 2021, 1:20 AM

Oh sorry, I missed how it happened. LGTM :)

This revision is now accepted and ready to land.Jul 7 2021, 1:20 AM