From: Chris Lattner Date: Fri, 31 Mar 2006 02:12:18 +0000 (+0000) Subject: Make sure to pass enough values to phi nodes when we are dealing with X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7e02151ce2686687446ba7293e66d6b096106e68;p=oota-llvm.git Make sure to pass enough values to phi nodes when we are dealing with decimated vectors. This fixes UnitTests/Vector/sumarray-dbl.c git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27280 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 0b32352c689..1d05087b2a6 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2805,8 +2805,16 @@ void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB, // Remember that this register needs to added to the machine PHI node as // the input for this MBB. - unsigned NumElements = - TLI.getNumElements(TLI.getValueType(PN->getType())); + MVT::ValueType VT = TLI.getValueType(PN->getType()); + unsigned NumElements; + if (VT != MVT::Vector) + NumElements = TLI.getNumElements(VT); + else { + MVT::ValueType VT1,VT2; + NumElements = + TLI.getPackedTypeBreakdown(cast(PN->getType()), + VT1, VT2); + } for (unsigned i = 0, e = NumElements; i != e; ++i) PHINodesToUpdate.push_back(std::make_pair(MBBI++, Reg+i)); }