This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Support] Avoid multiplication in floorDiv / ceilDiv
ClosedPublic

Authored by herhut on Dec 21 2021, 1:57 AM.

Details

Summary

Using comparisons instead avoids potential overflow.

Diff Detail

Event Timeline

herhut created this revision.Dec 21 2021, 1:57 AM
herhut requested review of this revision.Dec 21 2021, 1:57 AM
ftynse accepted this revision.Dec 21 2021, 1:59 AM
This revision is now accepted and ready to land.Dec 21 2021, 1:59 AM
herhut updated this revision to Diff 395625.Dec 21 2021, 2:32 AM

Add tests and fix behaviour for zero case.

ftynse accepted this revision.Dec 21 2021, 2:33 AM
This revision was automatically updated to reflect the committed changes.