diff --git a/mlir/include/mlir/Analysis/Presburger/MPInt.h b/mlir/include/mlir/Analysis/Presburger/MPInt.h --- a/mlir/include/mlir/Analysis/Presburger/MPInt.h +++ b/mlir/include/mlir/Analysis/Presburger/MPInt.h @@ -362,6 +362,7 @@ 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))); }