[X86][AVX] Limit getFauxShuffleMask INSERT_SUBVECTOR support to 2 inputs
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 5 Oct 2018 21:44:19 +0000 (21:44 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 5 Oct 2018 21:44:19 +0000 (21:44 +0000)
rL343853 didn't limit the number of subinputs, but we don't currently support faux shuffles with more than 2 total inputs, so put a limiter in place until this is fixed.

Found by Artem Dergachev.

llvm-svn: 343891

llvm/lib/Target/X86/X86ISelLowering.cpp

index f63fd3e..4a6d16f 100644 (file)
@@ -6414,7 +6414,8 @@ static bool getFauxShuffleMask(SDValue N, SmallVectorImpl<int> &Mask,
         Mask[i + InsertIdx] = (NumElts * (1 + InputIdx)) + ExtractIdx + M;
       }
     }
-    return true;
+    // TODO - Add support for more than 1 subinput.
+    return Ops.size() <= 2;
   }
   case ISD::SCALAR_TO_VECTOR: {
     // Match against a scalar_to_vector of an extract from a vector,