Commit 2f35f000 authored by Hans Wennborg's avatar Hans Wennborg
Browse files

ReleaseNotes: matching wide stores (r362472)

llvm-svn: 370352
parent 7552a396
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -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