]> granicus.if.org Git - llvm/commitdiff
[DAGCombiner] Add missing one use check on the shuffle in the bitcast(shuffle(bitcast...
authorCraig Topper <craig.topper@intel.com>
Mon, 31 Dec 2018 05:40:46 +0000 (05:40 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 31 Dec 2018 05:40:46 +0000 (05:40 +0000)
Found while trying out some other changes so I don't really have a test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350172 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index dda4f0176b1cac561f3ac2e8efcb204735997e15..d6d1591ef039dc8bd382e5056339d9ae73512922 100644 (file)
@@ -10156,7 +10156,7 @@ SDValue DAGCombiner::visitBITCAST(SDNode *N) {
   // float vectors bitcast to integer vectors) into shuffles.
   // bitcast(shuffle(bitcast(s0),bitcast(s1))) -> shuffle(s0,s1)
   if (Level < AfterLegalizeDAG && TLI.isTypeLegal(VT) && VT.isVector() &&
-      N0->getOpcode() == ISD::VECTOR_SHUFFLE &&
+      N0->getOpcode() == ISD::VECTOR_SHUFFLE && N0.hasOneUse() &&
       VT.getVectorNumElements() >= N0.getValueType().getVectorNumElements() &&
       !(VT.getVectorNumElements() % N0.getValueType().getVectorNumElements())) {
     ShuffleVectorSDNode *SVN = cast<ShuffleVectorSDNode>(N0);