[PATCH] D23636: [ADT] Allocate memory less often by increase inline storage

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 17:13:32 PDT 2016


majnemer created this revision.
majnemer added reviewers: joker-eph, MatzeB, sanjoy.
majnemer added a subscriber: llvm-commits.

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.

https://reviews.llvm.org/D23636

Files:
  include/llvm/ADT/APInt.h
  lib/IR/LLVMContextImpl.h
  lib/Support/APInt.cpp
  unittests/ADT/APIntTest.cpp
  unittests/ADT/APSIntTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23636.68458.patch
Type: text/x-patch
Size: 44653 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160818/ab0bd536/attachment-0001.bin>


More information about the llvm-commits mailing list