| Issue |
83403
|
| Summary |
[X86] Failure to create load-ext + trunc-store on avx512 target
|
| Labels |
backend:X86,
missed-optimization
|
| Assignees |
|
| Reporter |
RKSimon
|
```ll
define void @cast_i16x4_to_u8x4(ptr %a0, ptr %a1) {
%1 = load <4 x i16>, ptr %a1
%2 = trunc <4 x i16> %1 to <4 x i8>
store <4 x i8> %2, ptr %a0
ret void
}
```
llc -mcpu=x86-64-v4
```asm
cast_i16x4_to_u8x4: # @cast_i16x4_to_u8x4
vmovq (%rsi), %xmm0 # xmm0 = mem[0],zero
vpmovwb %xmm0, %xmm0
vmovd %xmm0, (%rdi)
retq
```
This could be performed as:
```asm
cast_i16x4_to_u8x4: # @cast_i16x4_to_u8x4
vpmovsxwd (%rsi), %xmm0
vpmovdb %xmm0, (%rdi)
retq
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs