[X86] Make sure type is a vector before calling VT.getVectorNumElements() in combineLoopMAddPattern

Fixes PR38700.

llvm-svn: 340688
This commit is contained in:
Craig Topper 2018-08-25 17:23:43 +00:00
parent ef467acc2c
commit bce8680605
1 changed files with 1 additions and 1 deletions

View File

@ -39076,7 +39076,7 @@ static SDValue combineLoopMAddPattern(SDNode *N, SelectionDAG &DAG,
// If the vector size is less than 128, or greater than the supported RegSize,
// do not use PMADD.
if (VT.getVectorNumElements() < 8)
if (!VT.isVector() || VT.getVectorNumElements() < 8)
return SDValue();
if (Op0.getOpcode() != ISD::MUL)