Many MLIR APIs end up using a range of the same Type / Value repeated N times, due to the (function of the) dimensionality of the problem. Allocating a vector of N identical element is wasteful. Add `Repeated<T>` as PointerUnion variants in TypeRange and ValueRange, enabling O(1) storage for repeated elements. Size remains 2 pointers (16 bytes on 64-bit) for both range types. This required variable-width `PointerUnion` encoding added in https://github.com/llvm/llvm-project/pull/188167 on 32-bit systems. Also update several MLIR dialects and conversions to exercise the new code. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
17 KiB
17 KiB