[Mlir-commits] [llvm] [mlir] mlir/Presburger/MPInt: move into LLVM/ADT (PR #94953)
Ramkumar Ramachandra
llvmlistbot at llvm.org
Mon Jun 10 04:39:22 PDT 2024
================
@@ -0,0 +1,644 @@
+//===- MPInt.h - MPInt Class ------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This is a simple class to represent arbitrary precision signed integers.
+// Unlike APInt, one does not have to specify a fixed maximum size, and the
+// integer can take on any arbitrary values. This is optimized for small-values
+// by providing fast-paths for the cases when the value stored fits in 64-bits.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_MPINT_H
+#define LLVM_ADT_MPINT_H
+
+#include "llvm/ADT/SlowMPInt.h"
+#include "llvm/Support/raw_ostream.h"
+#include <numeric>
+
+namespace llvm {
+namespace detail {
+/// ---------------------------------------------------------------------------
+/// Some helpers from MLIR/MathExtras.
----------------
artagnon wrote:
I'm not sure how useful these are in general. There's already a `divideFloor` and `divideCeil` in MathExtras.h that work on unsigned integers. At the moment, `ceilDiv` and `floorDiv` exist in `MLIR/MathExtras.h`, and are used exclusively by MLIR.
https://github.com/llvm/llvm-project/pull/94953
More information about the Mlir-commits
mailing list