Previously, APInt was a tagged union between a single 64-bit value and a
pointer.
Extensive profiling revealed that an application of LLVM was spending
35% of its time allocating and freeing memory for 65-bit APInts.
This patch proposes to change our representation for APInts by adding an
additional 64-bit value.
On platforms which support 128-bit arithmetic, __u?int128_t is used to
speed up APInt computations for bitwidths between 65 and 128.
I would appreciate help benchmarking this change. It dramatically
speeds up my application of LLVM but more data would be gratefully
appreciated.
If VAL was a pair, or a struct { uint64_t Low, High; }, it'd be copyable directly. Also I'd rather read Val.Low instead of Val[0].