From 7a1202ed4580d12943142caaf251f1a387c00828 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Thu, 29 Aug 2019 13:03:14 +0000 Subject: [PATCH] ReleaseNotes: matching wide stores (r362472) git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@370352 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ReleaseNotes.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst index aa0dd9bb8e3..b9630087cb7 100644 --- a/docs/ReleaseNotes.rst +++ b/docs/ReleaseNotes.rst @@ -85,6 +85,30 @@ Noteworthy optimizations `bug 42763 _` and `post commit discussion _`. +* 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 -- 2.40.0