[PATCH] D151029: [DAG] Combine insert(shuffle(load), load, 0) into a single load

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 10:08:47 PDT 2023


dmgreen added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:20927
+  if (!Shuffle || !all_of(enumerate(Shuffle->getMask()), [&](auto P) {
+        return InsIndex == P.index() ||
+               (InsIndex == 0 && P.value() == (int)P.index() - 1) ||
----------------
RKSimon wrote:
> I think we could allow undef mask elements as well, but we'd have to ensure that we could still deference the entire vector width?
Sounds good. I think, as we have the original full load, we can dereference the whole vector even if the elements are the shuffle are undef (if I've understanding you correctly). We might have a "less undefined" output though, which knows less lanes are undef/poison.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151029/new/

https://reviews.llvm.org/D151029



More information about the llvm-commits mailing list