Issue 129056
Summary [X86] Failure to merge PINSRW insertions
Labels backend:X86, missed-optimization
Assignees
Reporter RKSimon
    ```ll
define <16 x i16> @ff(<16 x i16> %x, i16 %s) {
  %i0 = insertelement <16 x i16> %x, i16 %s, i32 0
  %i1 = insertelement <16 x i16> %i0, i16 %s, i32 8
  ret <16 x i16> %i1
}
```
llc -mcpu=x86-64-v3
```asm
ff: # @ff
  vpinsrw $0, %edi, %xmm0, %xmm1
  vpblendd $15, %ymm1, %ymm0, %ymm0 # ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
  vmovd %edi, %xmm1
  vpbroadcastw %xmm1, %ymm1
  vpblendw $1, %ymm1, %ymm0, %ymm1 # ymm1 = ymm1[0],ymm0[1,2,3,4,5,6,7],ymm1[8],ymm0[9,10,11,12,13,14,15]
  vpblendd $240, %ymm1, %ymm0, %ymm0 # ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
 retq
```
This should just perform the vmovd+vpbroadcastw to transfer %edi once 
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to