forked from OSchip/llvm-project
[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:
parent
82f76c0477
commit
9390b8d34c
|
@ -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)));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue