From 9390b8d34ce3a7f2bad33672ea8089e0b26e1f91 Mon Sep 17 00:00:00 2001 From: Arjun P Date: Fri, 15 Jul 2022 17:25:40 +0100 Subject: [PATCH] [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 --- mlir/include/mlir/Analysis/Presburger/MPInt.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mlir/include/mlir/Analysis/Presburger/MPInt.h b/mlir/include/mlir/Analysis/Presburger/MPInt.h index 85288f8..a979107 100644 --- a/mlir/include/mlir/Analysis/Presburger/MPInt.h +++ b/mlir/include/mlir/Analysis/Presburger/MPInt.h @@ -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))); } -- 2.7.4