aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOutliner.cpp
diff options
context:
space:
mode:
authorPrinceton Ferro <princetonferro@gmail.com>2024-09-03 23:54:36 -0700
committerGitHub <noreply@github.com>2024-09-04 08:54:36 +0200
commit427e202a401514cb28bf2ca621baae8e1b2f552f (patch)
treebdc67c6a6f1a4c0c33e390685c03887b16f6616e /llvm/lib/CodeGen/MachineOutliner.cpp
parent06286832db0c4ee1899f9cee1b8f6234e45f16c7 (diff)
downloadllvm-427e202a401514cb28bf2ca621baae8e1b2f552f.zip
llvm-427e202a401514cb28bf2ca621baae8e1b2f552f.tar.gz
llvm-427e202a401514cb28bf2ca621baae8e1b2f552f.tar.bz2
[APInt] improve initialization performance (#106945)
The purpose is to save an extra memset in both cases: 1. When `int64_t(val) < 0`, zeroing out is redundant as the subsequent for-loop will initialize to `val .. 0xFFFFF ....`. Instead we should only create an uninitialized buffer, and transform the slow for-loop into a memset to initialize the higher words to `0xFF`. 2. In the other case, first we create an uninitialized array (`new int64_t[]`) and _then_ we zero it out with `memset`. But this can be combined in one operation with `new int64_t[]()`, which default-initializes the array. On one example where use of APInt was heavy, this improved compile time by 1%.
Diffstat (limited to 'llvm/lib/CodeGen/MachineOutliner.cpp')
0 files changed, 0 insertions, 0 deletions