[llvm] [X86] Combine `store + vselect` to `masked_store` (PR #145176)
Abhishek Kaushik via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 22 08:43:42 PDT 2025
abhishek-kaushik22 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.
Is that safe to do? There might be other stores in between the store and load, and we don't have any alias information
https://github.com/llvm/llvm-project/pull/145176
More information about the llvm-commits
mailing list