[llvm-bugs] [Bug 45314] New: Redundant vmov{q, d} before 32-bit splat
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Mar 26 05:48:00 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=45314
Bug ID: 45314
Summary: Redundant vmov{q,d} before 32-bit splat
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: X86
Assignee: unassignedbugs at nondot.org
Reporter: daan at dsprenkels.com
CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
llvm-dev at redking.me.uk, spatel+llvm at rotateright.com
The following code:
```
#include <immintrin.h>
__m256i broadcast(const __m256i x) {
return _mm256_set_epi32(x[0], x[0], x[0], x[0], x[0], x[0], x[0], x[0]);
}
```
is compiled to:
```
broadcast: # @broadcast
vmovq rax, xmm0
vmovd xmm0, eax
vpbroadcastd ymm0, xmm0
ret
```
These two vmov operations are redundant.
GCC already omits these operations:
```
broadcast:
vpbroadcastd ymm0, xmm0
ret
```
Godbolt link: https://c.godbolt.org/z/bkVDWj
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200326/12645cd1/attachment-0001.html>
More information about the llvm-bugs
mailing list