[X86] In WidenMaskArithmetic, make sure we check the input type of a truncate on N1.

Later in the code we explicitly bypass the truncate so we should be checking its type to make sure that it's safe.

llvm-svn: 321407
This commit is contained in:
Craig Topper 2017-12-23 18:53:03 +00:00
parent dbbbb8532c
commit e79a7a4b2e
1 changed files with 2 additions and 1 deletions

View File

@ -33046,7 +33046,8 @@ static SDValue WidenMaskArithmetic(SDNode *N, SelectionDAG &DAG,
return SDValue();
// The right side has to be a 'trunc' or a constant vector.
bool RHSTrunc = N1.getOpcode() == ISD::TRUNCATE;
bool RHSTrunc = N1.getOpcode() == ISD::TRUNCATE &&
N1.getOperand(0).getValueType() == VT;
ConstantSDNode *RHSConstSplat = nullptr;
if (auto *RHSBV = dyn_cast<BuildVectorSDNode>(N1))
RHSConstSplat = RHSBV->getConstantSplatNode();