[libcxx-commits] [PATCH] D96966: [libc++] Remove temporary stack-allocated array

Dominic Chen via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 18 08:36:21 PST 2021

ddcc created this revision.
ddcc added reviewers: ldionne, curdeius, EricWF.
ddcc requested review of this revision.
Herald added a project: libc++.
Herald added a reviewer: libc++.

Manual inspection of generated IR shows temporary stack allocation

  rG LLVM Github Monorepo



Index: libcxx/include/string
--- libcxx/include/string
+++ libcxx/include/string
@@ -1558,9 +1558,8 @@
     void __zero() _NOEXCEPT
-            size_type (&__a)[__n_words] = __r_.first().__r.__words;
             for (unsigned __i = 0; __i < __n_words; ++__i)
-                __a[__i] = 0;
+                __r_.first().__r.__words[__i] = 0;
     template <size_type __a> static

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96966.324659.patch
Type: text/x-patch
Size: 504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210218/8f48fa9e/attachment.bin>

More information about the libcxx-commits mailing list