[PATCH] D31961: DAGCombine: Combine shuffles of splat-shuffles

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 06:27:57 PDT 2017


zvi added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14622-14624
+// If splat-mask contains undef elements, we need to be careful about
+// introducing undef's in the folded mask which are not the result of composing
+// the masks of the shuffles.
----------------
spatel wrote:
> Do you think we'll need to distinguish between the "strict" splat and splat-with-undef cases anywhere else? I'm wondering if it would be better to add a bool "HasAnyUndefs" param to ShuffleVectorSDNode::isSplat(). Even if we don't have another use case at the moment, that would at least make the API more like BuildVectorSDNode::isConstantSplat().
Not sure about that, i can try to survey the code for such case.
I could find only one real use of "HasAnyUndefs" for the build_vector API in PPCISelLowering.cpp.


================
Comment at: test/CodeGen/X86/shuffle-of-splat-multiuses.ll:77
+; AVX2-NEXT:    vpshufd {{.*#+}} xmm0 = xmm0[2,3,2,3]
+; AVX2-NEXT:    vmovdqa %xmm0, (%rdi)
+; AVX2-NEXT:    vmovdqa %xmm1, %xmm0
----------------
zvi wrote:
> These two moves seem like a result of suboptimal scheduling + register allocation choices.
Opened [[ https://bugs.llvm.org/show_bug.cgi?id=32719 | Bug 32719 ]] to discuss the extra copy issue


Repository:
  rL LLVM

https://reviews.llvm.org/D31961





More information about the llvm-commits mailing list