[llvm] [APInt] remove getClearedMemory and improve slow initialization (PR #106945)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 2 00:56:57 PDT 2024
================
@@ -2105,7 +2100,7 @@ void APInt::fromString(unsigned numbits, StringRef str, uint8_t radix) {
if (isSingleWord())
U.VAL = 0;
else
- U.pVal = getClearedMemory(getNumWords());
+ U.pVal = new WordType[getNumWords()]();
----------------
nikic wrote:
This one looks completely wrong, because the following code relies on a full zero initialization.
https://github.com/llvm/llvm-project/pull/106945
More information about the llvm-commits
mailing list