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

Nikita Popov llvmlistbot at llvm.org
Mon Jun 10 04:50:30 PDT 2024


https://github.com/nikic commented:

Moving this to ADT sounds reasonable. Some high-level thoughts after a brief look:

 * The name MPInt isn't great, in that it does not give you any idea on what the difference between APInt and MPInt is supposed to be. Calling this DynamicAPInt would make it clearer that the prime distinction is the dynamic bit width.
 * The representation of MPInt seems somewhat non-optimal to me, in that it has the separate `unsigned HoldsLarge` field -- we could use `APInt.BitWidth == 0` to indicate this and cut the structure by 8 bytes (I think? I don't think the APInt padding would get used with the current implementation). This probably wasn't an option with the class in MLIR, but if it's in ADT we can make it a friend of APInt and make use of internal implementation details.

But I guess it would make sense to move it first and do any implementation changes later. I'd still consider whether it might make sense to adjust the name as part of the move (but I also don't feel very strongly about that).

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


More information about the Mlir-commits mailing list