This is an archive of the discontinued LLVM Phabricator instance.

[unittest] Exercise SCEV's udiv and udiv ceiling routines
ClosedPublic

Authored by reames on Jul 15 2021, 10:56 AM.

Details

Summary

The ceiling variant was recently added (due to the work towards D105216), and we're spending a lot of time trying to find optimizations for the expression. This patch brute forces the space of i8 unsigned divides and checks that we get a correct (well consistent with APInt) result for both udiv and udiv ceiling.

(This is basically what I've been doing locally in a hand rolled C++ program, and I realized there no good reason not to check it in as a unit test which directly exercises the logic on constants.)

Diff Detail

Event Timeline

reames created this revision.Jul 15 2021, 10:56 AM
reames requested review of this revision.Jul 15 2021, 10:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2021, 10:56 AM
This revision is now accepted and ready to land.Jul 15 2021, 11:31 AM
This revision was landed with ongoing or failed builds.Jul 15 2021, 11:59 AM
This revision was automatically updated to reflect the committed changes.