From bce8680605644df6143487ec7789375608486ffa Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 25 Aug 2018 17:23:43 +0000 Subject: [PATCH] [X86] Make sure type is a vector before calling VT.getVectorNumElements() in combineLoopMAddPattern Fixes PR38700. llvm-svn: 340688 --- llvm/lib/Target/X86/X86ISelLowering.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 111096b1d5c1..ed16e3289ec3 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -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)