[llvm] [LoadStoreVectorizer] Fill gaps in load/store chains to enable vectorization (PR #159388)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 26 02:53:20 PDT 2025
nikic wrote:
> I prototyped an approach that uses this instead, and it did work. Only real downsides are in implementation difficulty: it places a higher burden on the backend to efficiently lower masked loads, requires other passes to keep masked loads in mind when optimizing loads, etc. **But if we are confident that the current proposed approach is functionally incorrect, then I can and will pivot to that approach instead.**
I wouldn't say I'm *confident* that we can't make it work in this form, but it's the kind of thing that gets bogged down in extended IR design discussions. If the masked load variant isn't too hard to get working, then it's probably more expedient to just go with that.
> Two small details I want to get thoughts on before I proceed:
>
> * the masked load intrinsic includes this "pass through" vector as a parameter, which contains values to return in the positions of the masked-off elements. Can/should I fill that input vector with poison in this case, since those values should never be used?
Yes, using poison passthru should be fine.
> * I will need to adjust some of the generic SelectionDag backend files to properly handle masked loads with `MD_invariant_load" metadata. Currently that metadata gets dropped when the SelectionDAG is built. I assume this would be an acceptable change?
Without knowing the details: Yes, that sounds fine to me.
https://github.com/llvm/llvm-project/pull/159388
More information about the llvm-commits
mailing list