This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Support mul in SCEVLoopGuardRewriter
Needs ReviewPublic

Authored by dmakogon on Mar 3 2023, 4:42 AM.

Details

Summary

Adds support for these SCEVs to cover more cases.

Diff Detail

Event Timeline

dmakogon created this revision.Mar 3 2023, 4:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2023, 4:42 AM
dmakogon requested review of this revision.Mar 3 2023, 4:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2023, 4:42 AM
nikic added a subscriber: nikic.Mar 3 2023, 6:16 AM

We could also rewrite all types like this: https://github.com/llvm/llvm-project/commit/137e813953991caa93cfe439808618045a3e6311

There is a bit of compile time impact from doing that (though in part it's code size correlated): http://llvm-compile-time-tracker.com/compare.php?from=e00c73c856a325008afead10cfb3e9d0fc4a1e41&to=137e813953991caa93cfe439808618045a3e6311&stat=instructions:u
And code size seems to consistently increase: http://llvm-compile-time-tracker.com/compare.php?from=e00c73c856a325008afead10cfb3e9d0fc4a1e41&to=137e813953991caa93cfe439808618045a3e6311&stat=size-text Not sure if that means something is going wrong, or all optimizations this enables happen to be size increasing.

mkazantsev added inline comments.Mar 5 2023, 8:32 PM
llvm/test/Analysis/ScalarEvolution/trip-count-minmax.ll
168

Regression

llvm/test/Analysis/ScalarEvolution/trip-count9.ll
286

Regression. Do you know why?

mkazantsev added inline comments.Mar 5 2023, 8:35 PM
llvm/test/Analysis/ScalarEvolution/trip-count9.ll
424

Same

I do not know if this trip count is used for anything useful, but its fragility is concerning.