llvm-project
llvm-project copied to clipboard
[X86] CompressEVEX - extend tryCompressVPMOVPattern to handle VBLENDV patterns as well
tryCompressVPMOVPattern handles:
// Try to compress VPMOV*2M + KMOV chain patterns:
// vpmov*2m %xmm0, %k0 -> (erase this)
// kmov* %k0, %eax -> vmovmskp* %xmm0, %eax
but we should be able to do something VERY similar for BLENDV masked moves:
// vpmov*2m %xmmZ, %k0 -> (erase this)
// vpmovaps %xmmX, %xmmY {%k0} -> vblendvps %xmmZ, %xmmY, %xmmX, %xmmY
Should work for VBLENDVB/PS/PD 128 and 256-bit cases.
There might be some issues with register liveness to address - not sure.
@llvm/issue-subscribers-backend-x86
Author: Simon Pilgrim (RKSimon)
tryCompressVPMOVPattern handles:
```
// Try to compress VPMOV*2M + KMOV chain patterns:
// vpmov*2m %xmm0, %k0 -> (erase this)
// kmov* %k0, %eax -> vmovmskp* %xmm0, %eax
```
but we should be able to do something VERY similar for BLENDV masked moves:
```
// vpmov*2m %xmmZ, %k0 -> (erase this)
// vpmovaps %xmmX, %xmmY {%k0} -> vblendvps %xmmZ, %xmmX, %xmmY, %xmmY
```
Should work for VBLENDVB/PS/PD 128 and 256-bit cases.
There might be some issues with register liveness to address - not sure.
I'll take a look and work on a PR for this.