[MLIR][Presburger] introduce SlowMPInt, an auto-resizing APInt for fully correct...
authorArjun P <arjunpitchanathan@gmail.com>
Wed, 22 Jun 2022 16:29:46 +0000 (18:29 +0200)
committerArjun P <arjunpitchanathan@gmail.com>
Wed, 22 Jun 2022 16:37:18 +0000 (18:37 +0200)
commit628a2c14e3e94442672bb3b07cd42ec9cca04531
tree951c5df7f8b823f195bcb3d68f5b60d0b7f970b9
parentcff4f04e2ed8f4c0a69ddbdf07f6dcbec455a3e0
[MLIR][Presburger] introduce SlowMPInt, an auto-resizing APInt for fully correct signed integer computations

The Presburger library currently uses int64_t throughout for its integers.
This runs the risk of silently producing incorrect results when overflows occur.
Fixing this issue requires some sort of multiprecision integer
that transparently supports aribtrary arithmetic computations.

The class SlowMPInt provides this functionality, and is intended to be used
as the slow path fallback for a more optimized upcoming class, MPInt, that optimizes
for the Presburger library's workloads.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D123758
mlir/include/mlir/Analysis/Presburger/SlowMPInt.h [new file with mode: 0644]
mlir/lib/Analysis/Presburger/CMakeLists.txt
mlir/lib/Analysis/Presburger/SlowMPInt.cpp [new file with mode: 0644]
mlir/unittests/Analysis/Presburger/CMakeLists.txt
mlir/unittests/Analysis/Presburger/SlowMPIntTest.cpp [new file with mode: 0644]