[llvm] [APInt] remove getClearedMemory and improve slow initialization (PR #106945)

Princeton Ferro via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 01:00:44 PDT 2024


================
@@ -93,7 +88,7 @@ void APInt::initFromArray(ArrayRef<uint64_t> bigVal) {
     U.VAL = bigVal[0];
   else {
     // Get memory, cleared to 0
-    U.pVal = getClearedMemory(getNumWords());
+    U.pVal = new WordType[getNumWords()]();
----------------
Prince781 wrote:

The default-initialization of `WordType` in this case should be zero-initialization.

https://github.com/llvm/llvm-project/pull/106945


More information about the llvm-commits mailing list