[Mlir-commits] [llvm] [mlir] mlir/Presburger/MPInt: move into LLVM/ADT (PR #94953)

Thorsten Schütt llvmlistbot at llvm.org
Mon Jun 10 06:19:40 PDT 2024


================
@@ -0,0 +1,138 @@
+//===- SlowMPInt.h - SlowMPInt 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 class is to be used as a fallback slow path for the MPInt class, and
+// is not intended to be used directly.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_SLOWMPINT_H
+#define LLVM_ADT_SLOWMPINT_H
+
+#include "llvm/ADT/APInt.h"
+#include "llvm/Support/raw_ostream.h"
+
+namespace llvm {
+namespace detail {
+/// A simple class providing multi-precision arithmetic. Internally, it stores
+/// an APInt, whose width is doubled whenever an overflow occurs at a certain
+/// width. The default constructor sets the initial width to 64. SlowMPInt is
+/// primarily intended to be used as a slow fallback path for the upcoming MPInt
+/// class.
+class SlowMPInt {
+private:
----------------
tschuett wrote:

Why the `private`? It is already private.

https://github.com/llvm/llvm-project/pull/94953


More information about the Mlir-commits mailing list