This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Don't try to reuse expressions with offset
ClosedPublic

Authored by nikic on Feb 22 2022, 1:57 AM.

Details

Summary

SCEVs ExprValueMap currently tracks not only which IR Values correspond to a given SCEV expression, but additionally stores that it may be expanded in the form X+Offset. In theory, this allows reusing existing IR Values in more cases.

In practice, this doesn't seem to be particularly useful (the test changes are rather underwhelming) and adds a good bit of complexity. Per https://github.com/llvm/llvm-project/issues/53905, we seems to have an invalidation issue with these offseted expressions.

So I was wondering whether this functionality it really worthwhile, and whether we would be better off dropping it entirely.

Diff Detail

Event Timeline

nikic created this revision.Feb 22 2022, 1:57 AM
nikic requested review of this revision.Feb 22 2022, 1:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2022, 1:57 AM
mkazantsev accepted this revision.Feb 24 2022, 8:44 PM

I don't think I ever saw a case where it was useful. Pretty sure that if it causes some performance issues, we have other means to address them.

This revision is now accepted and ready to land.Feb 24 2022, 8:44 PM
This revision was landed with ongoing or failed builds.Feb 25 2022, 12:20 AM
This revision was automatically updated to reflect the committed changes.