From: Simon Pilgrim Date: Sat, 17 Oct 2015 16:49:43 +0000 (+0000) Subject: [DAG] Ensure vector constant folding uses correct scalar undef types X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=114db87382813de635450d88dded16511aea1fda;p=oota-llvm.git [DAG] Ensure vector constant folding uses correct scalar undef types Minor fix to D13665 found during post-commit review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250616 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 2ff20774eae..6d613436b8f 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3321,11 +3321,11 @@ SDValue SelectionDAG::FoldConstantVectorArithmetic(unsigned Opcode, SDLoc DL, for (unsigned i = 0; i != NumElts; i++) { SmallVector ScalarOps; for (SDValue Op : Ops) { - EVT InSVT = Op->getValueType(0).getScalarType(); + EVT InSVT = Op.getValueType().getScalarType(); BuildVectorSDNode *InBV = dyn_cast(Op); if (!InBV) { // We've checked that this is UNDEF above. - ScalarOps.push_back(getUNDEF(LegalSVT)); + ScalarOps.push_back(getUNDEF(InSVT)); continue; }