[llvm-branch-commits] [llvm-branch] r370352 - ReleaseNotes: matching wide stores (r362472)

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 29 06:03:14 PDT 2019


Author: hans
Date: Thu Aug 29 06:03:14 2019
New Revision: 370352

URL: http://llvm.org/viewvc/llvm-project?rev=370352&view=rev
Log:
ReleaseNotes: matching wide stores (r362472)

Modified:
    llvm/branches/release_90/docs/ReleaseNotes.rst

Modified: llvm/branches/release_90/docs/ReleaseNotes.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/docs/ReleaseNotes.rst?rev=370352&r1=370351&r2=370352&view=diff
==============================================================================
--- llvm/branches/release_90/docs/ReleaseNotes.rst (original)
+++ llvm/branches/release_90/docs/ReleaseNotes.rst Thu Aug 29 06:03:14 2019
@@ -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




More information about the llvm-branch-commits mailing list