[PATCH] D140811: [DAGCombiner][X86] `visitVECTOR_SHUFFLE()`: splats with a single non-undef element are not splats

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 31 14:05:00 PST 2022


lebedev.ri added a comment.

In D140811#4021032 <https://reviews.llvm.org/D140811#4021032>, @RKSimon wrote:

> Cheers - I'll review the x86 diffs and get back to you

Thank you for taking a look!
I've de-shedded a number of regressions off of D140677 <https://reviews.llvm.org/D140677>,
but the last few remaining are a last few for a reason :S



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:23792
+    // might be free. But only if there are at least two non-undef indices.
+    if (OtherSVN->isSplat() &&
+        count(OtherSVN->getMask(), OtherSVN->getSplatIndex()) > 1)
----------------
RKSimon wrote:
> Instead of the count() - it might be worth adding a bool arg to isSplat()/isSplatMask() to only match splats with more than a single matching element?
Sure, and i think that should even be default.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140811



More information about the llvm-commits mailing list