OSDN Git Service

ReleaseNotes: matching wide stores (r362472)
authorHans Wennborg <hans@hanshq.net>
Thu, 29 Aug 2019 13:03:14 +0000 (13:03 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 29 Aug 2019 13:03:14 +0000 (13:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@370352 91177308-0d34-0410-b5e6-96231b3b80d8

docs/ReleaseNotes.rst

index aa0dd9b..b963008 100644 (file)
@@ -85,6 +85,30 @@ Noteworthy optimizations
   `bug 42763 <https://bugs.llvm.org/show_bug.cgi?id=42763>_` and
   `post commit discussion <http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190422/646945.html>_`.  
 
+* LLVM will now pattern match wide scalar values stored by a succession of
+  narrow stores. For example, Clang will compile the following function that
+  writes a 32-bit value in big-endian order in a portable manner:
+
+  .. code-block:: c
+
+      void write32be(unsigned char *dst, uint32_t x) {
+        dst[0] = x >> 24;
+        dst[1] = x >> 16;
+        dst[2] = x >> 8;
+        dst[3] = x >> 0;
+      }
+
+  into the x86_64 code below:
+
+  .. code-block:: asm
+
+   write32be:
+           bswap   esi
+           mov     dword ptr [rdi], esi
+           ret
+
+  (The corresponding read patterns have been matched since LLVM 5.)
+
 * LLVM will now omit range checks for jump tables when lowering switches with
   unreachable default destination. For example, the switch dispatch in the C++
   code below