[PATCH] D38696: [DAGCombine] Permit combining of shuffle of equivalent splat BUILD_VECTORs

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 11:43:04 PDT 2017


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:15492-15493
 
+  // If both inputs are splats of the same value then we can safely merge this
+  // to a single BUILD_VECTOR with only the common undef elements.
+  auto *BV0 = dyn_cast<BuildVectorSDNode>(N0);
----------------
spatel wrote:
> Is this more conservative than necessary? If the shuffle mask is choosing an undef lane from either input, then the output would still be undef?
Agreed, I started trying to integrate this into the existing code below but I gave up as it was getting very convoluted. I'll update the code so that it just finds a single splat value.


Repository:
  rL LLVM

https://reviews.llvm.org/D38696





More information about the llvm-commits mailing list