Skip to content

Commit

Permalink
[MLIR][Presburger] MPInt: add missing fastpath in ceilDiv
Browse files Browse the repository at this point in the history
This is not a bug in functionality, just a missed optimization.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D129815
  • Loading branch information
Superty committed Jul 15, 2022
1 parent 82f76c0 commit 9390b8d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mlir/include/mlir/Analysis/Presburger/MPInt.h
Expand Up @@ -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)));
}
Expand Down

0 comments on commit 9390b8d

Please sign in to comment.