[PATCH] D107068: [DAG] DAGCombiner::visitVECTOR_SHUFFLE - recognise INSERT_SUBVECTOR patterns.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 09:46:48 PDT 2021


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:21308-21310
+      // Don't bother if we have a unary shuffle.
+      if (all_of(Mask, [NumElts](int M) { return M < (int)NumElts; }))
+        return SDValue();
----------------
lebedev.ri wrote:
> +` Undef's are okay.`
> 
> I believe we can't have `-2` (zero) mask elements yet here?
Yeah - SelectionDAG::getVectorShuffle asserts: "M < (NElts * 2) && M >= -1;"

I'll add a comment making to clear undefs are ok


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107068



More information about the llvm-commits mailing list