From 4157c417a12f0479bfba3b5520413e9897b8a3ee Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 2 Apr 2005 04:00:59 +0000 Subject: fix some bugs in the implementation of SHL_PARTS and friends. llvm-svn: 21004 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 7f15e19f9d5..005bb725753 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -907,6 +907,14 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, case ISD::DYNAMIC_STACKALLOC: // DYNAMIC_STACKALLOC produces pointer and chain N->setValueTypes(VT, MVT::Other); break; + + case ISD::SRA_PARTS: + case ISD::SRL_PARTS: + case ISD::SHL_PARTS: { + std::vector V(N->getNumOperands()-1, VT); + N->setValueTypes(V); + break; + } } // FIXME: memoize NODES @@ -924,9 +932,7 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, default: // FIXME: MEMOIZE!! SDNode *N = new SDNode(Opcode, Children); - if (Opcode != ISD::ADD_PARTS && Opcode != ISD::SUB_PARTS && - Opcode != ISD::SRA_PARTS && Opcode != ISD::SRL_PARTS && - Opcode != ISD::SHL_PARTS) { + if (Opcode != ISD::ADD_PARTS && Opcode != ISD::SUB_PARTS) { N->setValueTypes(VT); } else { std::vector V(N->getNumOperands()/2, VT); -- cgit v1.2.3