From: Chris Lattner Date: Mon, 12 Dec 2005 22:27:43 +0000 (+0000) Subject: Fix CodeGen/Generic/2005-12-12-ExpandSextInreg.ll X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=58f7963b8b3cb8894623a7d7663cc54005fea8f9;p=oota-llvm.git Fix CodeGen/Generic/2005-12-12-ExpandSextInreg.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24677 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 620b6439c68..6896fb39e26 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -3196,6 +3196,16 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){ Lo = LegalizeOp(Node->getOperand(0)); Hi = LegalizeOp(Node->getOperand(1)); break; + + case ISD::SIGN_EXTEND_INREG: + ExpandOp(Node->getOperand(0), Lo, Hi); + // Sign extend the lo-part. + Hi = DAG.getNode(ISD::SRA, NVT, Lo, + DAG.getConstant(MVT::getSizeInBits(NVT)-1, + TLI.getShiftAmountTy())); + // sext_inreg the low part if needed. + Lo = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Lo, Node->getOperand(1)); + break; case ISD::CTPOP: ExpandOp(Node->getOperand(0), Lo, Hi);