[llvm] [X86] Combine `store + vselect` to `masked_store` (PR #145176)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 22 06:32:39 PDT 2025


phoebewang wrote:

> > Can we use a pattern match instead?
> 
> There was no `m_Load` to match the Load, so I've added one.

I mean add
```
def: Pat<(st_frag (_.VT (vselect_mask _.KRCWM:$mask, (_.VT _.RC:$src), (_.VT (ld_frag addr:$dst)))), addr:$dst), (!cast<Instruction>(Name#_.ZSuffix#mrk) addr:$ptr, _.KRCWM:$mask, _.RC:$src)>;
def: Pat<(st_frag (_.VT (vselect_mask _.KRCWM:$mask, (_.VT _.RC:$src), _.ImmAllZerosV)), addr:$dst), (!cast<Instruction>(Name#_.ZSuffix#mrkz) addr:$ptr, _.KRCWM:$mask, _.RC:$src)>;
```
to avx512_store.

https://github.com/llvm/llvm-project/pull/145176


More information about the llvm-commits mailing list