This is an archive of the discontinued LLVM Phabricator instance.

[LoopVectorize] Preserve SCEV
ClosedPublic

Authored by nikic on Apr 25 2023, 5:13 AM.

Details

Summary

As far as I can tell, LoopVectorize preserves SCEV, mainly by dint of forgetting the loop being vectorized. We should mark it as preserved in the pass manager.

This is a very small compile-time improvement: http://llvm-compile-time-tracker.com/compare.php?from=a1677bda7975a0f690292587a04b9e053aacd1dc&to=bb3b36e5587a636f51e59a76d2e26db07ceea9ff&stat=instructions:u

Diff Detail

Event Timeline

nikic created this revision.Apr 25 2023, 5:13 AM
nikic requested review of this revision.Apr 25 2023, 5:13 AM
fhahn accepted this revision.Apr 26 2023, 12:14 AM

LGTM, thanks! As mentioned in the description, LV should properly invalidate SCEV for the IR it touches.

This revision is now accepted and ready to land.Apr 26 2023, 12:14 AM

(it might surface additional general missed SCEV invalidation patterns, but it's better to bite that bullet and fix those going forward IMO)

This revision was landed with ongoing or failed builds.Apr 26 2023, 12:44 AM
This revision was automatically updated to reflect the committed changes.