[llvm] [InstCombine] Simple store-to-load forwaring between fixed/scalable vectors (PR #124577)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 11:57:41 PST 2025


https://github.com/nikic commented:

> The @llvm.vector.insert is matched instead of the load itself because it is
> invalid to create a temporary insert of a scalable vector (the stored
> value) into a fixed-sized vector (the load type).

I don't really understand this part. Can't we replace the load with an llvm.vector.extract? And then for your particular pattern the llvm.vector.extract + llvm.vector.insert pair will fold away?

If we can root this at the load, it would be better to add support for this in GVN/VNCoercion (or add it there first). InstCombine load-store forwarding exists to handle simple cases, while GVN does this in full generality.

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


More information about the llvm-commits mailing list