Skip to content

Commit 2f35f00

Browse files
committed
ReleaseNotes: matching wide stores (r362472)
llvm-svn: 370352
1 parent 7552a39 commit 2f35f00

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

llvm/docs/ReleaseNotes.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,30 @@ Noteworthy optimizations
8585
`bug 42763 <https://bugs.llvm.org/show_bug.cgi?id=42763>_` and
8686
`post commit discussion <http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190422/646945.html>_`.
8787

88+
* LLVM will now pattern match wide scalar values stored by a succession of
89+
narrow stores. For example, Clang will compile the following function that
90+
writes a 32-bit value in big-endian order in a portable manner:
91+
92+
.. code-block:: c
93+
94+
void write32be(unsigned char *dst, uint32_t x) {
95+
dst[0] = x >> 24;
96+
dst[1] = x >> 16;
97+
dst[2] = x >> 8;
98+
dst[3] = x >> 0;
99+
}
100+
101+
into the x86_64 code below:
102+
103+
.. code-block:: asm
104+
105+
write32be:
106+
bswap esi
107+
mov dword ptr [rdi], esi
108+
ret
109+
110+
(The corresponding read patterns have been matched since LLVM 5.)
111+
88112
* LLVM will now omit range checks for jump tables when lowering switches with
89113
unreachable default destination. For example, the switch dispatch in the C++
90114
code below

0 commit comments

Comments
 (0)