[MLIR][Presburger] MPInt: add missing fastpath in ceilDiv

This is not a bug in functionality, just a missed optimization.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D129815
This commit is contained in:
Arjun P 2022-07-15 17:25:40 +01:00
parent 82f76c0477
commit 9390b8d34c
1 changed files with 1 additions and 0 deletions

View File

@ -362,6 +362,7 @@ LLVM_ATTRIBUTE_ALWAYS_INLINE MPInt ceilDiv(const MPInt &lhs, const MPInt &rhs) {
if (LLVM_LIKELY(lhs.isSmall() && rhs.isSmall())) {
if (LLVM_UNLIKELY(detail::divWouldOverflow(lhs.getSmall(), rhs.getSmall())))
return -lhs;
return MPInt(mlir::ceilDiv(lhs.getSmall(), rhs.getSmall()));
}
return MPInt(ceilDiv(detail::SlowMPInt(lhs), detail::SlowMPInt(rhs)));
}