From: Chris Lattner Date: Mon, 15 Mar 2010 16:15:56 +0000 (+0000) Subject: SIGN_EXTEND from the same type as the dest is valid. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=ed7d10e1000ae88c9ec7a0db6002eb8b8543a470;p=oota-llvm.git SIGN_EXTEND from the same type as the dest is valid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98548 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 5d38fdd5b9e..480c0680880 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2332,7 +2332,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, switch (Opcode) { default: break; case ISD::SIGN_EXTEND: - return getConstant(APInt(Val).sext(VT.getSizeInBits()), VT); + return getConstant(APInt(Val).sextOrTrunc(VT.getSizeInBits()), VT); case ISD::ANY_EXTEND: case ISD::ZERO_EXTEND: case ISD::TRUNCATE: