[llvm] [X86] Recognise vectors with zeros in all upper elements to improve VMOVS*Z folding (PR #193263)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 22 01:07:21 PDT 2026


RKSimon wrote:

> > Currently the VMOVSHZ (etc.) patterns are mainly limited to merging with X86vzmovl patterns which explicitly demonstrate the upper elements should be zero (and we can remove the X86vzmovl node).
> 
> Does it mean we will replace it with X86vzelts in the future?

No, in the X86vzmovl case we can remove the X86vzmovl node and use its src operand directly - with X86vzelts we don't know the exact form of the src operand(s) (it could be an address from X86vzload, a shuffle whatever) - so it has to stay. We just make use of the knowledge that the upper elements were zero already, and VMOVSHZ will set them to zero again.

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


More information about the llvm-commits mailing list