commit | ed7d10e1000ae88c9ec7a0db6002eb8b8543a470 | [log] [tgz] |
---|---|---|
author | Chris Lattner <sabre@nondot.org> | Mon Mar 15 16:15:56 2010 +0000 |
committer | Chris Lattner <sabre@nondot.org> | Mon Mar 15 16:15:56 2010 +0000 |
tree | 3ce397ac43b21774b0c70e58a3615ffbcbbc41b6 | |
parent | 7fb5c2dbec26b7de959269ade8906a7a1b6c7539 [diff] [blame] |
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 5d38fdd..480c068 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2332,7 +2332,7 @@ 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: