File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,30 @@ Noteworthy optimizations
85
85
`bug 42763 <https://bugs.llvm.org/show_bug.cgi?id=42763>_ ` and
86
86
`post commit discussion <http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190422/646945.html>_ `.
87
87
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
+
88
112
* LLVM will now omit range checks for jump tables when lowering switches with
89
113
unreachable default destination. For example, the switch dispatch in the C++
90
114
code below
You can’t perform that action at this time.
0 commit comments